'),this.$element.append(this.$stage.parent()),this.replace(this.$element.children().not(this.$stage.parent())),this._width=this.$element.width(),this.refresh(),this.$element.removeClass("owl-loading").addClass("owl-loaded"),this.eventsCall(),this.internalEvents(),this.addTriggerableEvents(),this.trigger("initialized")},e.prototype.setup=function(){var b=this.viewport(),c=this.options.responsive,d=-1,e=null;c?(a.each(c,function(a){b>=a&&a>d&&(d=Number(a))}),e=a.extend({},this.options,c[d]),delete e.responsive,e.responsiveClass&&this.$element.attr("class",function(a,b){return b.replace(/\b owl-responsive-\S+/g,"")}).addClass("owl-responsive-"+d)):e=a.extend({},this.options),(null===this.settings||this._breakpoint!==d)&&(this.trigger("change",{property:{name:"settings",value:e}}),this._breakpoint=d,this.settings=e,this.invalidate("settings"),this.trigger("changed",{property:{name:"settings",value:this.settings}}))},e.prototype.optionsLogic=function(){this.$element.toggleClass("owl-center",this.settings.center),this.settings.loop&&this._items.length
").addClass(this.settings.itemClass).append(b)),this.trigger("prepared",{content:c.data}),c.data},e.prototype.update=function(){for(var b=0,c=this._pipe.length,d=a.proxy(function(a){return this[a]},this._invalidated),e={};c>b;)(this._invalidated.all||a.grep(this._pipe[b].filter,d).length>0)&&this._pipe[b].run(e),b++;this._invalidated={}},e.prototype.width=function(a){switch(a=a||e.Width.Default){case e.Width.Inner:case e.Width.Outer:return this._width;default:return this._width-2*this.settings.stagePadding+this.settings.margin}},e.prototype.refresh=function(){if(0===this._items.length)return!1;(new Date).getTime();this.trigger("refresh"),this.setup(),this.optionsLogic(),this.$stage.addClass("owl-refresh"),this.update(),this.$stage.removeClass("owl-refresh"),this.state.orientation=b.orientation,this.watchVisibility(),this.trigger("refreshed")},e.prototype.eventsCall=function(){this.e._onDragStart=a.proxy(function(a){this.onDragStart(a)},this),this.e._onDragMove=a.proxy(function(a){this.onDragMove(a)},this),this.e._onDragEnd=a.proxy(function(a){this.onDragEnd(a)},this),this.e._onResize=a.proxy(function(a){this.onResize(a)},this),this.e._transitionEnd=a.proxy(function(a){this.transitionEnd(a)},this),this.e._preventClick=a.proxy(function(a){this.preventClick(a)},this)},e.prototype.onThrottledResize=function(){b.clearTimeout(this.resizeTimer),this.resizeTimer=b.setTimeout(this.e._onResize,this.settings.responsiveRefreshRate)},e.prototype.onResize=function(){return this._items.length?this._width===this.$element.width()?!1:this.trigger("resize").isDefaultPrevented()?!1:(this._width=this.$element.width(),this.invalidate("width"),this.refresh(),void this.trigger("resized")):!1},e.prototype.eventsRouter=function(a){var b=a.type;"mousedown"===b||"touchstart"===b?this.onDragStart(a):"mousemove"===b||"touchmove"===b?this.onDragMove(a):"mouseup"===b||"touchend"===b?this.onDragEnd(a):"touchcancel"===b&&this.onDragEnd(a)},e.prototype.internalEvents=function(){var c=(k(),l());this.settings.mouseDrag?(this.$stage.on("mousedown",a.proxy(function(a){this.eventsRouter(a)},this)),this.$stage.on("dragstart",function(){return!1}),this.$stage.get(0).onselectstart=function(){return!1}):this.$element.addClass("owl-text-select-on"),this.settings.touchDrag&&!c&&this.$stage.on("touchstart touchcancel",a.proxy(function(a){this.eventsRouter(a)},this)),this.transitionEndVendor&&this.on(this.$stage.get(0),this.transitionEndVendor,this.e._transitionEnd,!1),this.settings.responsive!==!1&&this.on(b,"resize",a.proxy(this.onThrottledResize,this))},e.prototype.onDragStart=function(d){var e,g,h,i;if(e=d.originalEvent||d||b.event,3===e.which||this.state.isTouch)return!1;if("mousedown"===e.type&&this.$stage.addClass("owl-grab"),this.trigger("drag"),this.drag.startTime=(new Date).getTime(),this.speed(0),this.state.isTouch=!0,this.state.isScrolling=!1,this.state.isSwiping=!1,this.drag.distance=0,g=f(e).x,h=f(e).y,this.drag.offsetX=this.$stage.position().left,this.drag.offsetY=this.$stage.position().top,this.settings.rtl&&(this.drag.offsetX=this.$stage.position().left+this.$stage.width()-this.width()+this.settings.margin),this.state.inMotion&&this.support3d)i=this.getTransformProperty(),this.drag.offsetX=i,this.animate(i),this.state.inMotion=!0;else if(this.state.inMotion&&!this.support3d)return this.state.inMotion=!1,!1;this.drag.startX=g-this.drag.offsetX,this.drag.startY=h-this.drag.offsetY,this.drag.start=g-this.drag.startX,this.drag.targetEl=e.target||e.srcElement,this.drag.updatedX=this.drag.start,("IMG"===this.drag.targetEl.tagName||"A"===this.drag.targetEl.tagName)&&(this.drag.targetEl.draggable=!1),a(c).on("mousemove.owl.dragEvents mouseup.owl.dragEvents touchmove.owl.dragEvents touchend.owl.dragEvents",a.proxy(function(a){this.eventsRouter(a)},this))},e.prototype.onDragMove=function(a){var c,e,g,h,i,j;this.state.isTouch&&(this.state.isScrolling||(c=a.originalEvent||a||b.event,e=f(c).x,g=f(c).y,this.drag.currentX=e-this.drag.startX,this.drag.currentY=g-this.drag.startY,this.drag.distance=this.drag.currentX-this.drag.offsetX,this.drag.distance<0?this.state.direction=this.settings.rtl?"right":"left":this.drag.distance>0&&(this.state.direction=this.settings.rtl?"left":"right"),this.settings.loop?this.op(this.drag.currentX,">",this.coordinates(this.minimum()))&&"right"===this.state.direction?this.drag.currentX-=(this.settings.center&&this.coordinates(0))-this.coordinates(this._items.length):this.op(this.drag.currentX,"<",this.coordinates(this.maximum()))&&"left"===this.state.direction&&(this.drag.currentX+=(this.settings.center&&this.coordinates(0))-this.coordinates(this._items.length)):(h=this.coordinates(this.settings.rtl?this.maximum():this.minimum()),i=this.coordinates(this.settings.rtl?this.minimum():this.maximum()),j=this.settings.pullDrag?this.drag.distance/5:0,this.drag.currentX=Math.max(Math.min(this.drag.currentX,h+j),i+j)),(this.drag.distance>8||this.drag.distance<-8)&&(c.preventDefault!==d?c.preventDefault():c.returnValue=!1,this.state.isSwiping=!0),this.drag.updatedX=this.drag.currentX,(this.drag.currentY>16||this.drag.currentY<-16)&&this.state.isSwiping===!1&&(this.state.isScrolling=!0,this.drag.updatedX=this.drag.start),this.animate(this.drag.updatedX)))},e.prototype.onDragEnd=function(b){var d,e,f;if(this.state.isTouch){if("mouseup"===b.type&&this.$stage.removeClass("owl-grab"),this.trigger("dragged"),this.drag.targetEl.removeAttribute("draggable"),this.state.isTouch=!1,this.state.isScrolling=!1,this.state.isSwiping=!1,0===this.drag.distance&&this.state.inMotion!==!0)return this.state.inMotion=!1,!1;this.drag.endTime=(new Date).getTime(),d=this.drag.endTime-this.drag.startTime,e=Math.abs(this.drag.distance),(e>3||d>300)&&this.removeClick(this.drag.targetEl),f=this.closest(this.drag.updatedX),this.speed(this.settings.dragEndSpeed||this.settings.smartSpeed),this.current(f),this.invalidate("position"),this.update(),this.settings.pullDrag||this.drag.updatedX!==this.coordinates(f)||this.transitionEnd(),this.drag.distance=0,a(c).off(".owl.dragEvents")}},e.prototype.removeClick=function(c){this.drag.targetEl=c,a(c).on("click.preventClick",this.e._preventClick),b.setTimeout(function(){a(c).off("click.preventClick")},300)},e.prototype.preventClick=function(b){b.preventDefault?b.preventDefault():b.returnValue=!1,b.stopPropagation&&b.stopPropagation(),a(b.target).off("click.preventClick")},e.prototype.getTransformProperty=function(){var a,c;return a=b.getComputedStyle(this.$stage.get(0),null).getPropertyValue(this.vendorName+"transform"),a=a.replace(/matrix(3d)?\(|\)/g,"").split(","),c=16===a.length,c!==!0?a[4]:a[12]},e.prototype.closest=function(b){var c=-1,d=30,e=this.width(),f=this.coordinates();return this.settings.freeDrag||a.each(f,a.proxy(function(a,g){return b>g-d&&g+d>b?c=a:this.op(b,"<",g)&&this.op(b,">",f[a+1]||g-e)&&(c="left"===this.state.direction?a+1:a),-1===c},this)),this.settings.loop||(this.op(b,">",f[this.minimum()])?c=b=this.minimum():this.op(b,"<",f[this.maximum()])&&(c=b=this.maximum())),c},e.prototype.animate=function(b){this.trigger("translate"),this.state.inMotion=this.speed()>0,this.support3d?this.$stage.css({transform:"translate3d("+b+"px,0px, 0px)",transition:this.speed()/1e3+"s"}):this.state.isTouch?this.$stage.css({left:b+"px"}):this.$stage.animate({left:b},this.speed()/1e3,this.settings.fallbackEasing,a.proxy(function(){this.state.inMotion&&this.transitionEnd()},this))},e.prototype.current=function(a){if(a===d)return this._current;if(0===this._items.length)return d;if(a=this.normalize(a),this._current!==a){var b=this.trigger("change",{property:{name:"position",value:a}});b.data!==d&&(a=this.normalize(b.data)),this._current=a,this.invalidate("position"),this.trigger("changed",{property:{name:"position",value:this._current}})}return this._current},e.prototype.invalidate=function(a){this._invalidated[a]=!0},e.prototype.reset=function(a){a=this.normalize(a),a!==d&&(this._speed=0,this._current=a,this.suppress(["translate","translated"]),this.animate(this.coordinates(a)),this.release(["translate","translated"]))},e.prototype.normalize=function(b,c){var e=c?this._items.length:this._items.length+this._clones.length;return!a.isNumeric(b)||1>e?d:b=this._clones.length?(b%e+e)%e:Math.max(this.minimum(c),Math.min(this.maximum(c),b))},e.prototype.relative=function(a){return a=this.normalize(a),a-=this._clones.length/2,this.normalize(a,!0)},e.prototype.maximum=function(a){var b,c,d,e=0,f=this.settings;if(a)return this._items.length-1;if(!f.loop&&f.center)b=this._items.length-1;else if(f.loop||f.center)if(f.loop||f.center)b=this._items.length+f.items;else{if(!f.autoWidth&&!f.merge)throw"Can not detect maximum absolute position.";for(revert=f.rtl?1:-1,c=this.$stage.width()-this.$element.width();(d=this.coordinates(e))&&!(d*revert>=c);)b=++e}else b=this._items.length-f.items;return b},e.prototype.minimum=function(a){return a?0:this._clones.length/2},e.prototype.items=function(a){return a===d?this._items.slice():(a=this.normalize(a,!0),this._items[a])},e.prototype.mergers=function(a){return a===d?this._mergers.slice():(a=this.normalize(a,!0),this._mergers[a])},e.prototype.clones=function(b){var c=this._clones.length/2,e=c+this._items.length,f=function(a){return a%2===0?e+a/2:c-(a+1)/2};return b===d?a.map(this._clones,function(a,b){return f(b)}):a.map(this._clones,function(a,c){return a===b?f(c):null})},e.prototype.speed=function(a){return a!==d&&(this._speed=a),this._speed},e.prototype.coordinates=function(b){var c=null;return b===d?a.map(this._coordinates,a.proxy(function(a,b){return this.coordinates(b)},this)):(this.settings.center?(c=this._coordinates[b],c+=(this.width()-c+(this._coordinates[b-1]||0))/2*(this.settings.rtl?-1:1)):c=this._coordinates[b-1]||0,c)},e.prototype.duration=function(a,b,c){return Math.min(Math.max(Math.abs(b-a),1),6)*Math.abs(c||this.settings.smartSpeed)},e.prototype.to=function(c,d){if(this.settings.loop){var e=c-this.relative(this.current()),f=this.current(),g=this.current(),h=this.current()+e,i=0>g-h?!0:!1,j=this._clones.length+this._items.length;h
=j-this.settings.items&&i===!0&&(f=g-this._items.length,this.reset(f)),b.clearTimeout(this.e._goToLoop),this.e._goToLoop=b.setTimeout(a.proxy(function(){this.speed(this.duration(this.current(),f+e,d)),this.current(f+e),this.update()},this),30)}else this.speed(this.duration(this.current(),c,d)),this.current(c),this.update()},e.prototype.next=function(a){a=a||!1,this.to(this.relative(this.current())+1,a)},e.prototype.prev=function(a){a=a||!1,this.to(this.relative(this.current())-1,a)},e.prototype.transitionEnd=function(a){return a!==d&&(a.stopPropagation(),(a.target||a.srcElement||a.originalTarget)!==this.$stage.get(0))?!1:(this.state.inMotion=!1,void this.trigger("translated"))},e.prototype.viewport=function(){var d;if(this.options.responsiveBaseElement!==b)d=a(this.options.responsiveBaseElement).width();else if(b.innerWidth)d=b.innerWidth;else{if(!c.documentElement||!c.documentElement.clientWidth)throw"Can not detect viewport width.";d=c.documentElement.clientWidth}return d},e.prototype.replace=function(b){this.$stage.empty(),this._items=[],b&&(b=b instanceof jQuery?b:a(b)),this.settings.nestedItemSelector&&(b=b.find("."+this.settings.nestedItemSelector)),b.filter(function(){return 1===this.nodeType}).each(a.proxy(function(a,b){b=this.prepare(b),this.$stage.append(b),this._items.push(b),this._mergers.push(1*b.find("[data-merge]").andSelf("[data-merge]").attr("data-merge")||1)},this)),this.reset(a.isNumeric(this.settings.startPosition)?this.settings.startPosition:0),this.invalidate("items")},e.prototype.add=function(a,b){b=b===d?this._items.length:this.normalize(b,!0),this.trigger("add",{content:a,position:b}),0===this._items.length||b===this._items.length?(this.$stage.append(a),this._items.push(a),this._mergers.push(1*a.find("[data-merge]").andSelf("[data-merge]").attr("data-merge")||1)):(this._items[b].before(a),this._items.splice(b,0,a),this._mergers.splice(b,0,1*a.find("[data-merge]").andSelf("[data-merge]").attr("data-merge")||1)),this.invalidate("items"),this.trigger("added",{content:a,position:b})},e.prototype.remove=function(a){a=this.normalize(a,!0),a!==d&&(this.trigger("remove",{content:this._items[a],position:a}),this._items[a].remove(),this._items.splice(a,1),this._mergers.splice(a,1),this.invalidate("items"),this.trigger("removed",{content:null,position:a}))},e.prototype.addTriggerableEvents=function(){var b=a.proxy(function(b,c){return a.proxy(function(a){a.relatedTarget!==this&&(this.suppress([c]),b.apply(this,[].slice.call(arguments,1)),this.release([c]))},this)},this);a.each({next:this.next,prev:this.prev,to:this.to,destroy:this.destroy,refresh:this.refresh,replace:this.replace,add:this.add,remove:this.remove},a.proxy(function(a,c){this.$element.on(a+".owl.carousel",b(c,a+".owl.carousel"))},this))},e.prototype.watchVisibility=function(){function c(a){return a.offsetWidth>0&&a.offsetHeight>0}function d(){c(this.$element.get(0))&&(this.$element.removeClass("owl-hidden"),this.refresh(),b.clearInterval(this.e._checkVisibile))}c(this.$element.get(0))||(this.$element.addClass("owl-hidden"),b.clearInterval(this.e._checkVisibile),this.e._checkVisibile=b.setInterval(a.proxy(d,this),500))},e.prototype.preloadAutoWidthImages=function(b){var c,d,e,f;c=0,d=this,b.each(function(g,h){e=a(h),f=new Image,f.onload=function(){c++,e.attr("src",f.src),e.css("opacity",1),c>=b.length&&(d.state.imagesLoaded=!0,d.initialize())},f.src=e.attr("src")||e.attr("data-src")||e.attr("data-src-retina")})},e.prototype.destroy=function(){this.$element.hasClass(this.settings.themeClass)&&this.$element.removeClass(this.settings.themeClass),this.settings.responsive!==!1&&a(b).off("resize.owl.carousel"),this.transitionEndVendor&&this.off(this.$stage.get(0),this.transitionEndVendor,this.e._transitionEnd);for(var d in this._plugins)this._plugins[d].destroy();(this.settings.mouseDrag||this.settings.touchDrag)&&(this.$stage.off("mousedown touchstart touchcancel"),a(c).off(".owl.dragEvents"),this.$stage.get(0).onselectstart=function(){},this.$stage.off("dragstart",function(){return!1})),this.$element.off(".owl"),this.$stage.children(".cloned").remove(),this.e=null,this.$element.removeData("owlCarousel"),this.$stage.children().contents().unwrap(),this.$stage.children().unwrap(),this.$stage.unwrap()},e.prototype.op=function(a,b,c){var d=this.settings.rtl;switch(b){case"<":return d?a>c:c>a;case">":return d?c>a:a>c;case">=":return d?c>=a:a>=c;case"<=":return d?a>=c:c>=a}},e.prototype.on=function(a,b,c,d){a.addEventListener?a.addEventListener(b,c,d):a.attachEvent&&a.attachEvent("on"+b,c)},e.prototype.off=function(a,b,c,d){a.removeEventListener?a.removeEventListener(b,c,d):a.detachEvent&&a.detachEvent("on"+b,c)},e.prototype.trigger=function(b,c,d){var e={item:{count:this._items.length,index:this.current()}},f=a.camelCase(a.grep(["on",b,d],function(a){return a}).join("-").toLowerCase()),g=a.Event([b,"owl",d||"carousel"].join(".").toLowerCase(),a.extend({relatedTarget:this},e,c));return this._supress[b]||(a.each(this._plugins,function(a,b){b.onTrigger&&b.onTrigger(g)}),this.$element.trigger(g),this.settings&&"function"==typeof this.settings[f]&&this.settings[f].apply(this,g)),g},e.prototype.suppress=function(b){a.each(b,a.proxy(function(a,b){this._supress[b]=!0},this))},e.prototype.release=function(b){a.each(b,a.proxy(function(a,b){delete this._supress[b]},this))},e.prototype.browserSupport=function(){if(this.support3d=j(),this.support3d){this.transformVendor=i();var a=["transitionend","webkitTransitionEnd","transitionend","oTransitionEnd"];this.transitionEndVendor=a[h()],this.vendorName=this.transformVendor.replace(/Transform/i,""),this.vendorName=""!==this.vendorName?"-"+this.vendorName.toLowerCase()+"-":""}this.state.orientation=b.orientation},a.fn.owlCarousel=function(b){return this.each(function(){a(this).data("owlCarousel")||a(this).data("owlCarousel",new e(this,b))})},a.fn.owlCarousel.Constructor=e}(window.Zepto||window.jQuery,window,document),function(a,b){var c=function(b){this._core=b,this._loaded=[],this._handlers={"initialized.owl.carousel change.owl.carousel":a.proxy(function(b){if(b.namespace&&this._core.settings&&this._core.settings.lazyLoad&&(b.property&&"position"==b.property.name||"initialized"==b.type))for(var c=this._core.settings,d=c.center&&Math.ceil(c.items/2)||c.items,e=c.center&&-1*d||0,f=(b.property&&b.property.value||this._core.current())+e,g=this._core.clones().length,h=a.proxy(function(a,b){this.load(b)},this);e++-1||(e.each(a.proxy(function(c,d){var e,f=a(d),g=b.devicePixelRatio>1&&f.attr("data-src-retina")||f.attr("data-src");this._core.trigger("load",{element:f,url:g},"lazy"),f.is("img")?f.one("load.owl.lazy",a.proxy(function(){f.css("opacity",1),this._core.trigger("loaded",{element:f,url:g},"lazy")},this)).attr("src",g):(e=new Image,e.onload=a.proxy(function(){f.css({"background-image":"url("+g+")",opacity:"1"}),this._core.trigger("loaded",{element:f,url:g},"lazy")},this),e.src=g)},this)),this._loaded.push(d.get(0)))},c.prototype.destroy=function(){var a,b;for(a in this.handlers)this._core.$element.off(a,this.handlers[a]);for(b in Object.getOwnPropertyNames(this))"function"!=typeof this[b]&&(this[b]=null)},a.fn.owlCarousel.Constructor.Plugins.Lazy=c}(window.Zepto||window.jQuery,window,document),function(a){var b=function(c){this._core=c,this._handlers={"initialized.owl.carousel":a.proxy(function(){this._core.settings.autoHeight&&this.update()},this),"changed.owl.carousel":a.proxy(function(a){this._core.settings.autoHeight&&"position"==a.property.name&&this.update()},this),"loaded.owl.lazy":a.proxy(function(a){this._core.settings.autoHeight&&a.element.closest("."+this._core.settings.itemClass)===this._core.$stage.children().eq(this._core.current())&&this.update()},this)},this._core.options=a.extend({},b.Defaults,this._core.options),this._core.$element.on(this._handlers)};b.Defaults={autoHeight:!1,autoHeightClass:"owl-height"},b.prototype.update=function(){this._core.$stage.parent().height(this._core.$stage.children().eq(this._core.current()).height()).addClass(this._core.settings.autoHeightClass)},b.prototype.destroy=function(){var a,b;for(a in this._handlers)this._core.$element.off(a,this._handlers[a]);for(b in Object.getOwnPropertyNames(this))"function"!=typeof this[b]&&(this[b]=null)},a.fn.owlCarousel.Constructor.Plugins.AutoHeight=b}(window.Zepto||window.jQuery,window,document),function(a,b,c){var d=function(b){this._core=b,this._videos={},this._playing=null,this._fullscreen=!1,this._handlers={"resize.owl.carousel":a.proxy(function(a){this._core.settings.video&&!this.isInFullScreen()&&a.preventDefault()},this),"refresh.owl.carousel changed.owl.carousel":a.proxy(function(){this._playing&&this.stop()},this),"prepared.owl.carousel":a.proxy(function(b){var c=a(b.content).find(".owl-video");c.length&&(c.css("display","none"),this.fetch(c,a(b.content)))},this)},this._core.options=a.extend({},d.Defaults,this._core.options),this._core.$element.on(this._handlers),this._core.$element.on("click.owl.video",".owl-video-play-icon",a.proxy(function(a){this.play(a)},this))};d.Defaults={video:!1,videoHeight:!1,videoWidth:!1},d.prototype.fetch=function(a,b){var c=a.attr("data-vimeo-id")?"vimeo":"youtube",d=a.attr("data-vimeo-id")||a.attr("data-youtube-id"),e=a.attr("data-width")||this._core.settings.videoWidth,f=a.attr("data-height")||this._core.settings.videoHeight,g=a.attr("href");if(!g)throw new Error("Missing video URL.");if(d=g.match(/(http:|https:|)\/\/(player.|www.)?(vimeo\.com|youtu(be\.com|\.be|be\.googleapis\.com))\/(video\/|embed\/|watch\?v=|v\/)?([A-Za-z0-9._%-]*)(\&\S+)?/),d[3].indexOf("youtu")>-1)c="youtube";else{if(!(d[3].indexOf("vimeo")>-1))throw new Error("Video URL not supported.");c="vimeo"}d=d[6],this._videos[g]={type:c,id:d,width:e,height:f},b.attr("data-video",g),this.thumbnail(a,this._videos[g])},d.prototype.thumbnail=function(b,c){var d,e,f,g=c.width&&c.height?'style="width:'+c.width+"px;height:"+c.height+'px;"':"",h=b.find("img"),i="src",j="",k=this._core.settings,l=function(a){e='',d=k.lazyLoad?'':'',b.after(d),b.after(e)};return b.wrap('"),this._core.settings.lazyLoad&&(i="data-src",j="owl-lazy"),h.length?(l(h.attr(i)),h.remove(),!1):void("youtube"===c.type?(f="http://img.youtube.com/vi/"+c.id+"/hqdefault.jpg",l(f)):"vimeo"===c.type&&a.ajax({type:"GET",url:"http://vimeo.com/api/v2/video/"+c.id+".json",jsonp:"callback",dataType:"jsonp",success:function(a){f=a[0].thumbnail_large,l(f)}}))},d.prototype.stop=function(){this._core.trigger("stop",null,"video"),this._playing.find(".owl-video-frame").remove(),this._playing.removeClass("owl-video-playing"),this._playing=null},d.prototype.play=function(b){this._core.trigger("play",null,"video"),this._playing&&this.stop();var c,d,e=a(b.target||b.srcElement),f=e.closest("."+this._core.settings.itemClass),g=this._videos[f.attr("data-video")],h=g.width||"100%",i=g.height||this._core.$stage.height();"youtube"===g.type?c='':"vimeo"===g.type&&(c=''),f.addClass("owl-video-playing"),this._playing=f,d=a(''+c+"
"),e.after(d)},d.prototype.isInFullScreen=function(){var d=c.fullscreenElement||c.mozFullScreenElement||c.webkitFullscreenElement;return d&&a(d).parent().hasClass("owl-video-frame")&&(this._core.speed(0),this._fullscreen=!0),d&&this._fullscreen&&this._playing?!1:this._fullscreen?(this._fullscreen=!1,!1):this._playing&&this._core.state.orientation!==b.orientation?(this._core.state.orientation=b.orientation,!1):!0},d.prototype.destroy=function(){var a,b;this._core.$element.off("click.owl.video");for(a in this._handlers)this._core.$element.off(a,this._handlers[a]);for(b in Object.getOwnPropertyNames(this))"function"!=typeof this[b]&&(this[b]=null)},a.fn.owlCarousel.Constructor.Plugins.Video=d}(window.Zepto||window.jQuery,window,document),function(a,b,c,d){var e=function(b){this.core=b,this.core.options=a.extend({},e.Defaults,this.core.options),this.swapping=!0,this.previous=d,this.next=d,this.handlers={"change.owl.carousel":a.proxy(function(a){"position"==a.property.name&&(this.previous=this.core.current(),this.next=a.property.value)},this),"drag.owl.carousel dragged.owl.carousel translated.owl.carousel":a.proxy(function(a){this.swapping="translated"==a.type},this),"translate.owl.carousel":a.proxy(function(){this.swapping&&(this.core.options.animateOut||this.core.options.animateIn)&&this.swap()},this)},this.core.$element.on(this.handlers)};e.Defaults={animateOut:!1,animateIn:!1},e.prototype.swap=function(){if(1===this.core.settings.items&&this.core.support3d){this.core.speed(0);var b,c=a.proxy(this.clear,this),d=this.core.$stage.children().eq(this.previous),e=this.core.$stage.children().eq(this.next),f=this.core.settings.animateIn,g=this.core.settings.animateOut;this.core.current()!==this.previous&&(g&&(b=this.core.coordinates(this.previous)-this.core.coordinates(this.next),d.css({left:b+"px"}).addClass("animated owl-animated-out").addClass(g).one("webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend",c)),f&&e.addClass("animated owl-animated-in").addClass(f).one("webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend",c))}},e.prototype.clear=function(b){a(b.target).css({left:""}).removeClass("animated owl-animated-out owl-animated-in").removeClass(this.core.settings.animateIn).removeClass(this.core.settings.animateOut),this.core.transitionEnd()},e.prototype.destroy=function(){var a,b;for(a in this.handlers)this.core.$element.off(a,this.handlers[a]);for(b in Object.getOwnPropertyNames(this))"function"!=typeof this[b]&&(this[b]=null)},a.fn.owlCarousel.Constructor.Plugins.Animate=e}(window.Zepto||window.jQuery,window,document),function(a,b,c){var d=function(b){this.core=b,this.core.options=a.extend({},d.Defaults,this.core.options),this.handlers={"translated.owl.carousel refreshed.owl.carousel":a.proxy(function(){this.autoplay()
},this),"play.owl.autoplay":a.proxy(function(a,b,c){this.play(b,c)},this),"stop.owl.autoplay":a.proxy(function(){this.stop()},this),"mouseover.owl.autoplay":a.proxy(function(){this.core.settings.autoplayHoverPause&&this.pause()},this),"mouseleave.owl.autoplay":a.proxy(function(){this.core.settings.autoplayHoverPause&&this.autoplay()},this)},this.core.$element.on(this.handlers)};d.Defaults={autoplay:!1,autoplayTimeout:5e3,autoplayHoverPause:!1,autoplaySpeed:!1},d.prototype.autoplay=function(){this.core.settings.autoplay&&!this.core.state.videoPlay?(b.clearInterval(this.interval),this.interval=b.setInterval(a.proxy(function(){this.play()},this),this.core.settings.autoplayTimeout)):b.clearInterval(this.interval)},d.prototype.play=function(){return c.hidden===!0||this.core.state.isTouch||this.core.state.isScrolling||this.core.state.isSwiping||this.core.state.inMotion?void 0:this.core.settings.autoplay===!1?void b.clearInterval(this.interval):void this.core.next(this.core.settings.autoplaySpeed)},d.prototype.stop=function(){b.clearInterval(this.interval)},d.prototype.pause=function(){b.clearInterval(this.interval)},d.prototype.destroy=function(){var a,c;b.clearInterval(this.interval);for(a in this.handlers)this.core.$element.off(a,this.handlers[a]);for(c in Object.getOwnPropertyNames(this))"function"!=typeof this[c]&&(this[c]=null)},a.fn.owlCarousel.Constructor.Plugins.autoplay=d}(window.Zepto||window.jQuery,window,document),function(a){"use strict";var b=function(c){this._core=c,this._initialized=!1,this._pages=[],this._controls={},this._templates=[],this.$element=this._core.$element,this._overrides={next:this._core.next,prev:this._core.prev,to:this._core.to},this._handlers={"prepared.owl.carousel":a.proxy(function(b){this._core.settings.dotsData&&this._templates.push(a(b.content).find("[data-dot]").andSelf("[data-dot]").attr("data-dot"))},this),"add.owl.carousel":a.proxy(function(b){this._core.settings.dotsData&&this._templates.splice(b.position,0,a(b.content).find("[data-dot]").andSelf("[data-dot]").attr("data-dot"))},this),"remove.owl.carousel prepared.owl.carousel":a.proxy(function(a){this._core.settings.dotsData&&this._templates.splice(a.position,1)},this),"change.owl.carousel":a.proxy(function(a){if("position"==a.property.name&&!this._core.state.revert&&!this._core.settings.loop&&this._core.settings.navRewind){var b=this._core.current(),c=this._core.maximum(),d=this._core.minimum();a.data=a.property.value>c?b>=c?d:c:a.property.value").addClass(d.dotClass).append(a("")).prop("outerHTML")]),d.navContainer&&d.dotsContainer||(this._controls.$container=a("").addClass(d.controlsClass).appendTo(this.$element)),this._controls.$indicators=d.dotsContainer?a(d.dotsContainer):a("
").hide().addClass(d.dotsClass).appendTo(this._controls.$container),this._controls.$indicators.on("click","div",a.proxy(function(b){var c=a(b.target).parent().is(this._controls.$indicators)?a(b.target).index():a(b.target).parent().index();b.preventDefault(),this.to(c,d.dotsSpeed)},this)),b=d.navContainer?a(d.navContainer):a("
").addClass(d.navContainerClass).prependTo(this._controls.$container),this._controls.$next=a("<"+d.navElement+">"),this._controls.$previous=this._controls.$next.clone(),this._controls.$previous.addClass(d.navClass[0]).html(d.navText[0]).hide().prependTo(b).on("click",a.proxy(function(){this.prev(d.navSpeed)},this)),this._controls.$next.addClass(d.navClass[1]).html(d.navText[1]).hide().appendTo(b).on("click",a.proxy(function(){this.next(d.navSpeed)},this));for(c in this._overrides)this._core[c]=a.proxy(this[c],this)},b.prototype.destroy=function(){var a,b,c,d;for(a in this._handlers)this.$element.off(a,this._handlers[a]);for(b in this._controls)this._controls[b].remove();for(d in this.overides)this._core[d]=this._overrides[d];for(c in Object.getOwnPropertyNames(this))"function"!=typeof this[c]&&(this[c]=null)},b.prototype.update=function(){var a,b,c,d=this._core.settings,e=this._core.clones().length/2,f=e+this._core.items().length,g=d.center||d.autoWidth||d.dotData?1:d.dotsEach||d.items;if("page"!==d.slideBy&&(d.slideBy=Math.min(d.slideBy,d.items)),d.dots||"page"==d.slideBy)for(this._pages=[],a=e,b=0,c=0;f>a;a++)(b>=g||0===b)&&(this._pages.push({start:a-e,end:a-e+g-1}),b=0,++c),b+=this._core.mergers(this._core.relative(a))},b.prototype.draw=function(){var b,c,d="",e=this._core.settings,f=(this._core.$stage.children(),this._core.relative(this._core.current()));if(!e.nav||e.loop||e.navRewind||(this._controls.$previous.toggleClass("disabled",0>=f),this._controls.$next.toggleClass("disabled",f>=this._core.maximum())),this._controls.$previous.toggle(e.nav),this._controls.$next.toggle(e.nav),e.dots){if(b=this._pages.length-this._controls.$indicators.children().length,e.dotData&&0!==b){for(c=0;c
0?(d=new Array(b+1).join(this._templates[0]),this._controls.$indicators.append(d)):0>b&&this._controls.$indicators.children().slice(b).remove();this._controls.$indicators.find(".active").removeClass("active"),this._controls.$indicators.children().eq(a.inArray(this.current(),this._pages)).addClass("active")}this._controls.$indicators.toggle(e.dots)},b.prototype.onTrigger=function(b){var c=this._core.settings;b.page={index:a.inArray(this.current(),this._pages),count:this._pages.length,size:c&&(c.center||c.autoWidth||c.dotData?1:c.dotsEach||c.items)}},b.prototype.current=function(){var b=this._core.relative(this._core.current());return a.grep(this._pages,function(a){return a.start<=b&&a.end>=b}).pop()},b.prototype.getPosition=function(b){var c,d,e=this._core.settings;return"page"==e.slideBy?(c=a.inArray(this.current(),this._pages),d=this._pages.length,b?++c:--c,c=this._pages[(c%d+d)%d].start):(c=this._core.relative(this._core.current()),d=this._core.items().length,b?c+=e.slideBy:c-=e.slideBy),c},b.prototype.next=function(b){a.proxy(this._overrides.to,this._core)(this.getPosition(!0),b)},b.prototype.prev=function(b){a.proxy(this._overrides.to,this._core)(this.getPosition(!1),b)},b.prototype.to=function(b,c,d){var e;d?a.proxy(this._overrides.to,this._core)(b,c):(e=this._pages.length,a.proxy(this._overrides.to,this._core)(this._pages[(b%e+e)%e].start,c))},a.fn.owlCarousel.Constructor.Plugins.Navigation=b}(window.Zepto||window.jQuery,window,document),function(a,b){"use strict";var c=function(d){this._core=d,this._hashes={},this.$element=this._core.$element,this._handlers={"initialized.owl.carousel":a.proxy(function(){"URLHash"==this._core.settings.startPosition&&a(b).trigger("hashchange.owl.navigation")},this),"prepared.owl.carousel":a.proxy(function(b){var c=a(b.content).find("[data-hash]").andSelf("[data-hash]").attr("data-hash");this._hashes[c]=b.content},this)},this._core.options=a.extend({},c.Defaults,this._core.options),this.$element.on(this._handlers),a(b).on("hashchange.owl.navigation",a.proxy(function(){var a=b.location.hash.substring(1),c=this._core.$stage.children(),d=this._hashes[a]&&c.index(this._hashes[a])||0;return a?void this._core.to(d,!1,!0):!1},this))};c.Defaults={URLhashListener:!1},c.prototype.destroy=function(){var c,d;a(b).off("hashchange.owl.navigation");for(c in this._handlers)this._core.$element.off(c,this._handlers[c]);for(d in Object.getOwnPropertyNames(this))"function"!=typeof this[d]&&(this[d]=null)},a.fn.owlCarousel.Constructor.Plugins.Hash=c}(window.Zepto||window.jQuery,window,document);
;(function($,window,document,undefined){(function(){"use strict";var lastTime=0,vendors=['ms','moz','webkit','o'],x;for(x=0;x').prependTo(this.$element);this.$slider=$('').prependTo(this.$mirror);this.$mirror.addClass('parallax-mirror').css({visibility:'visible',zIndex:this.zIndex,position:'absolute',top:0,left:0,width:"100%",height:"100%",overflow:'hidden'});this.$slider.addClass('parallax-slider').one('load',function(){if(!self.naturalHeight||!self.naturalWidth){self.naturalHeight=this.naturalHeight||this.height||1;self.naturalWidth=this.naturalWidth||this.width||1;}self.aspectRatio=self.naturalWidth/self.naturalHeight;Parallax.isSetup||Parallax.setup();Parallax.sliders.push(self);Parallax.isFresh=false;Parallax.requestRender();});this.$slider[0].src=this.imageSrc;if(this.naturalHeight&&this.naturalWidth||this.$slider[0].complete){this.$slider.trigger('load');}};$.extend(Parallax.prototype,{speed:0.2,bleed:0,zIndex:0,iosFix:true,androidFix:true,position:'center',overScrollFix:true,refresh:function(){this.boxWidth=this.$element.outerWidth();this.boxHeight=this.$element.outerHeight()+this.bleed*2;this.boxOffsetTop=this.$element.offset().top-this.bleed;this.boxOffsetLeft=this.$element.offset().left;this.boxOffsetBottom=this.boxOffsetTop+this.boxHeight;var winHeight=Parallax.winHeight;var docHeight=Parallax.docHeight;var maxOffset=Math.min(this.boxOffsetTop,docHeight-winHeight);var minOffset=Math.max(this.boxOffsetTop+this.boxHeight-winHeight,0);var imageHeightMin=this.boxHeight+(maxOffset-minOffset)*(1-this.speed)|0;var imageOffsetMin=(this.boxOffsetTop-maxOffset)*(1-this.speed)|0;if(imageHeightMin*this.aspectRatio>=this.boxWidth){this.imageWidth=imageHeightMin*this.aspectRatio|0;this.imageHeight=imageHeightMin;this.offsetBaseTop=imageOffsetMin;var margin=this.imageWidth-this.boxWidth;if(this.positionX=='left'){this.offsetLeft=0;}else if(this.positionX=='right'){this.offsetLeft=-margin;}else if(!isNaN(this.positionX)){this.offsetLeft=Math.max(this.positionX,-margin);}else{this.offsetLeft=-margin/2|0;}}else{this.imageWidth=this.boxWidth;this.imageHeight=this.boxWidth/this.aspectRatio|0;this.offsetLeft=0;var margin=this.imageHeight-imageHeightMin;if(this.positionY=='top'){this.offsetBaseTop=imageOffsetMin;}else if(this.positionY=='bottom'){this.offsetBaseTop=imageOffsetMin-margin;}else if(!isNaN(this.positionY)){this.offsetBaseTop=imageOffsetMin+Math.max(this.positionY,-margin);}else{this.offsetBaseTop=imageOffsetMin-margin/2|0;}}},render:function(){var scrollTop=Parallax.scrollTop;var scrollLeft=Parallax.scrollLeft;var overScroll=this.overScrollFix?Parallax.overScroll:0;var scrollBottom=scrollTop+Parallax.winHeight;if(this.boxOffsetBottom>scrollTop&&this.boxOffsetTop',t,""].join(""),h.id=g,(c?h:d).innerHTML+=n,d.appendChild(h),c||(d.style.background="",d.style.overflow="hidden",l=m.style.overflow,m.style.overflow="hidden",m.appendChild(d)),r=i(h,t),c?h.parentNode.removeChild(h):(d.parentNode.removeChild(d),m.style.overflow=l),!!r},C={}.hasOwnProperty;d=o(C,"undefined")||o(C.call,"undefined")?function(t,e){return e in t&&o(t.constructor.prototype[e],"undefined")}:function(t,e){return C.call(t,e)},Function.prototype.bind||(Function.prototype.bind=function(t){var e=this;if("function"!=typeof e)throw new TypeError;var i=Q.call(arguments,1),s=function(){if(this instanceof s){var o=function(){};o.prototype=e.prototype;var n=new o,r=e.apply(n,i.concat(Q.call(arguments)));return Object(r)===r?r:n}return e.apply(t,i.concat(Q.call(arguments)))};return s}),k.csstransforms3d=function(){var t=!!l("perspective");return t&&"webkitPerspective"in m.style&&T("@media (transform-3d),(-webkit-transform-3d){#modernizr{left:9px;position:absolute;height:3px;}}",function(e,i){t=9===e.offsetLeft&&3===e.offsetHeight}),t};for(var E in k)d(k,E)&&(c=E.toLowerCase(),p[c]=k[E](),S.push((p[c]?"":"no-")+c));return p.addTest=function(t,e){if("object"==typeof t)for(var s in t)d(t,s)&&p.addTest(s,t[s]);else{if(t=t.toLowerCase(),p[t]!==i)return p;e="function"==typeof e?e():e,"undefined"!=typeof f&&f&&(m.className+=" "+(e?"":"no-")+t),p[t]=e}return p},s(""),y=h=null,function(t,e){function i(t,e){var i=t.createElement("p"),s=t.getElementsByTagName("head")[0]||t.documentElement;return i.innerHTML="x",s.insertBefore(i.lastChild,s.firstChild)}function s(){var t=b.elements;return"string"==typeof t?t.split(" "):t}function o(t){var e=y[t[m]];return e||(e={},g++,t[m]=g,y[g]=e),e}function n(t,i,s){if(i||(i=e),c)return i.createElement(t);s||(s=o(i));var n;return n=s.cache[t]?s.cache[t].cloneNode():f.test(t)?(s.cache[t]=s.createElem(t)).cloneNode():s.createElem(t),!n.canHaveChildren||p.test(t)||n.tagUrn?n:s.frag.appendChild(n)}function r(t,i){if(t||(t=e),c)return t.createDocumentFragment();i=i||o(t);for(var n=i.frag.cloneNode(),r=0,a=s(),l=a.length;l>r;r++)n.createElement(a[r]);return n}function a(t,e){e.cache||(e.cache={},e.createElem=t.createElement,e.createFrag=t.createDocumentFragment,e.frag=e.createFrag()),t.createElement=function(i){return b.shivMethods?n(i,t,e):e.createElem(i)},t.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+s().join().replace(/[\w\-]+/g,function(t){return e.createElem(t),e.frag.createElement(t),'c("'+t+'")'})+");return n}")(b,e.frag)}function l(t){t||(t=e);var s=o(t);return b.shivCSS&&!h&&!s.hasCSS&&(s.hasCSS=!!i(t,"article,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}mark{background:#FF0;color:#000}template{display:none}")),c||a(t,s),t}var h,c,d="3.7.0",u=t.html5||{},p=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,f=/^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i,m="_html5shiv",g=0,y={};!function(){try{var t=e.createElement("a");t.innerHTML="",h="hidden"in t,c=1==t.childNodes.length||function(){e.createElement("a");var t=e.createDocumentFragment();return"undefined"==typeof t.cloneNode||"undefined"==typeof t.createDocumentFragment||"undefined"==typeof t.createElement}()}catch(i){h=!0,c=!0}}();var b={elements:u.elements||"abbr article aside audio bdi canvas data datalist details dialog figcaption figure footer header hgroup main mark meter nav output progress section summary template time video",version:d,shivCSS:u.shivCSS!==!1,supportsUnknownElements:c,shivMethods:u.shivMethods!==!1,type:"default",shivDocument:l,createElement:n,createDocumentFragment:r};t.html5=b,l(e)}(this,e),p._version=u,p._prefixes=v,p._domPrefixes=j,p._cssomPrefixes=w,p.testProp=function(t){return r([t])},p.testAllProps=l,p.testStyles=T,m.className=m.className.replace(/(^|\s)no-js(\s|$)/,"$1$2")+(f?" js "+S.join(" "):""),p}(this,this.document),function(t,e,i){function s(t){return"[object Function]"==g.call(t)}function o(t){return"string"==typeof t}function n(){}function r(t){return!t||"loaded"==t||"complete"==t||"uninitialized"==t}function a(){var t=y.shift();b=1,t?t.t?f(function(){("c"==t.t?u.injectCss:u.injectJs)(t.s,0,t.a,t.x,t.e,1)},0):(t(),a()):b=0}function l(t,i,s,o,n,l,h){function c(e){if(!p&&r(d.readyState)&&(v.r=p=1,!b&&a(),d.onload=d.onreadystatechange=null,e)){"img"!=t&&f(function(){w.removeChild(d)},50);for(var s in T[i])T[i].hasOwnProperty(s)&&T[i][s].onload()}}var h=h||u.errorTimeout,d=e.createElement(t),p=0,g=0,v={t:s,s:i,e:n,a:l,x:h};1===T[i]&&(g=1,T[i]=[]),"object"==t?d.data=i:(d.src=i,d.type=t),d.width=d.height="0",d.onerror=d.onload=d.onreadystatechange=function(){c.call(this,g)},y.splice(o,0,v),"img"!=t&&(g||2===T[i]?(w.insertBefore(d,x?null:m),f(c,h)):T[i].push(d))}function h(t,e,i,s,n){return b=0,e=e||"j",o(t)?l("c"==e?k:j,t,e,this.i++,i,s,n):(y.splice(this.i++,0,t),1==y.length&&a()),this}function c(){var t=u;return t.loader={load:h,i:0},t}var d,u,p=e.documentElement,f=t.setTimeout,m=e.getElementsByTagName("script")[0],g={}.toString,y=[],b=0,v="MozAppearance"in p.style,x=v&&!!e.createRange().compareNode,w=x?p:m.parentNode,p=t.opera&&"[object Opera]"==g.call(t.opera),p=!!e.attachEvent&&!p,j=v?"object":p?"script":"img",k=p?"script":j,S=Array.isArray||function(t){return"[object Array]"==g.call(t)},Q=[],T={},C={timeout:function(t,e){return e.length&&(t.timeout=e[0]),t}};u=function(t){function e(t){var e,i,s,t=t.split("!"),o=Q.length,n=t.pop(),r=t.length,n={url:n,origUrl:n,prefixes:t};for(i=0;r>i;i++)s=t[i].split("="),(e=C[s.shift()])&&(n=e(n,s));for(i=0;o>i;i++)n=Q[i](n);return n}function r(t,o,n,r,a){var l=e(t),h=l.autoCallback;l.url.split(".").pop().split("?").shift(),l.bypass||(o&&(o=s(o)?o:o[t]||o[r]||o[t.split("/").pop().split("?")[0]]),l.instead?l.instead(t,o,n,r,a):(T[l.url]?l.noexec=!0:T[l.url]=1,n.load(l.url,l.forceCSS||!l.forceJS&&"css"==l.url.split(".").pop().split("?").shift()?"c":i,l.noexec,l.attrs,l.timeout),(s(o)||s(h))&&n.load(function(){c(),o&&o(l.origUrl,a,r),h&&h(l.origUrl,a,r),T[l.url]=2})))}function a(t,e){function i(t,i){if(t){if(o(t))i||(d=function(){var t=[].slice.call(arguments);u.apply(this,t),p()}),r(t,d,e,0,h);else if(Object(t)===t)for(l in a=function(){var e,i=0;for(e in t)t.hasOwnProperty(e)&&i++;return i}(),t)t.hasOwnProperty(l)&&(!i&&!--a&&(s(d)?d=function(){var t=[].slice.call(arguments);u.apply(this,t),p()}:d[l]=function(t){return function(){var e=[].slice.call(arguments);t&&t.apply(this,e),p()}}(u[l])),r(t[l],d,e,l,h))}else!i&&p()}var a,l,h=!!t.test,c=t.load||t.both,d=t.callback||n,u=d,p=t.complete||n;i(h?t.yep:t.nope,!!c),c&&i(c)}var l,h,d=this.yepnope.loader;if(o(t))r(t,0,d,0);else if(S(t))for(l=0;ls;s++)if(t=i[s]+"ransform",t in n)return i[s].substr(0,i[s].length-1);return!1}();o.getTime=Date.now||function(){return(new Date).getTime()},o.extend=function(t,i){for(var s in i)t[s]=i[s]},o.addEvent=function(t,i,s,e){t.addEventListener?t.addEventListener(i,s,!!e):t.attachEvent(i,s)},o.removeEvent=function(t,i,s,e){t.removeEventListener(i,s,!!e)},o.momentum=function(t,i,e,o,n,r){var h,a,l=t-i,c=s.abs(l)/e;return r=void 0===r?6e-4:r,h=t+c*c/(2*r)*(0>l?-1:1),a=c/r,o>h?(h=n?o-n/2.5*(c/8):o,l=s.abs(h-t),a=l/c):h>0&&(h=n?n/2.5*(c/8):0,l=s.abs(t)+h,a=l/c),{destination:s.round(h),duration:a}};var h=e("transform");return o.extend(o,{hasTransform:h!==!1,hasPerspective:e("perspective")in n,hasTouch:"ontouchstart"in t,hasPointer:navigator.msPointerEnabled,hasTransition:e("transition")in n}),o.isBadAndroid=/Android /.test(t.navigator.appVersion)&&!/Chrome\/\d/.test(t.navigator.appVersion),o.extend(o.style={},{transform:h,transitionTimingFunction:e("transitionTimingFunction"),transitionDuration:e("transitionDuration"),transitionDelay:e("transitionDelay"),transformOrigin:e("transformOrigin")}),o.hasClass=function(t,i){var s=new RegExp("(^|\\s)"+i+"(\\s|$)");return s.test(t.className)},o.addClass=function(t,i){if(!o.hasClass(t,i)){var s=t.className.split(" ");s.push(i),t.className=s.join(" ")}},o.removeClass=function(t,i){if(o.hasClass(t,i)){var s=new RegExp("(^|\\s)"+i+"(\\s|$)","g");t.className=t.className.replace(s," ")}},o.offset=function(t){for(var i=-t.offsetLeft,s=-t.offsetTop;t=t.offsetParent;)i-=t.offsetLeft,s-=t.offsetTop;return{left:i,top:s}},o.preventDefaultException=function(t,i){for(var s in i)if(i[s].test(t[s]))return!0;return!1},o.extend(o.eventType={},{touchstart:1,touchmove:1,touchend:1,mousedown:2,mousemove:2,mouseup:2,MSPointerDown:3,MSPointerMove:3,MSPointerUp:3}),o.extend(o.ease={},{quadratic:{style:"cubic-bezier(0.25, 0.46, 0.45, 0.94)",fn:function(t){return t*(2-t)}},circular:{style:"cubic-bezier(0.1, 0.57, 0.1, 1)",fn:function(t){return s.sqrt(1- --t*t)}},back:{style:"cubic-bezier(0.175, 0.885, 0.32, 1.275)",fn:function(t){var i=4;return(t-=1)*t*((i+1)*t+i)+1}},bounce:{style:"",fn:function(t){return(t/=1)<1/2.75?7.5625*t*t:2/2.75>t?7.5625*(t-=1.5/2.75)*t+.75:2.5/2.75>t?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375}},elastic:{style:"",fn:function(t){var i=.22,e=.4;return 0===t?0:1==t?1:e*s.pow(2,-10*t)*s.sin(2*(t-i/4)*s.PI/i)+1}}}),o.tap=function(t,s){var e=i.createEvent("Event");e.initEvent(s,!0,!0),e.pageX=t.pageX,e.pageY=t.pageY,t.target.dispatchEvent(e)},o.click=function(t){var s,e=t.target;/(SELECT|INPUT|TEXTAREA)/i.test(e.tagName)||(s=i.createEvent("MouseEvents"),s.initMouseEvent("click",!0,!0,t.view,1,e.screenX,e.screenY,e.clientX,e.clientY,t.ctrlKey,t.altKey,t.shiftKey,t.metaKey,0,null),s._constructed=!0,e.dispatchEvent(s))},o}();e.prototype={version:"5.1.1",_init:function(){this._initEvents(),(this.options.scrollbars||this.options.indicators)&&this._initIndicators(),this.options.mouseWheel&&this._initWheel(),this.options.snap&&this._initSnap(),this.options.keyBindings&&this._initKeys()},destroy:function(){this._initEvents(!0),this._execEvent("destroy")},_transitionEnd:function(t){t.target==this.scroller&&this.isInTransition&&(this._transitionTime(),this.resetPosition(this.options.bounceTime)||(this.isInTransition=!1,this._execEvent("scrollEnd")))},_start:function(t){if(!(1!=h.eventType[t.type]&&0!==t.button||!this.enabled||this.initiated&&h.eventType[t.type]!==this.initiated)){!this.options.preventDefault||h.isBadAndroid||h.preventDefaultException(t.target,this.options.preventDefaultException)||t.preventDefault();var i,e=t.touches?t.touches[0]:t;this.initiated=h.eventType[t.type],this.moved=!1,this.distX=0,this.distY=0,this.directionX=0,this.directionY=0,this.directionLocked=0,this._transitionTime(),this.startTime=h.getTime(),this.options.useTransition&&this.isInTransition?(this.isInTransition=!1,i=this.getComputedPosition(),this._translate(s.round(i.x),s.round(i.y)),this._execEvent("scrollEnd")):!this.options.useTransition&&this.isAnimating&&(this.isAnimating=!1,this._execEvent("scrollEnd")),this.startX=this.x,this.startY=this.y,this.absStartX=this.x,this.absStartY=this.y,this.pointX=e.pageX,this.pointY=e.pageY,this._execEvent("beforeScrollStart")}},_move:function(t){if(this.enabled&&h.eventType[t.type]===this.initiated){this.options.preventDefault&&t.preventDefault();var i,e,o,n,r=t.touches?t.touches[0]:t,a=r.pageX-this.pointX,l=r.pageY-this.pointY,c=h.getTime();if(this.pointX=r.pageX,this.pointY=r.pageY,this.distX+=a,this.distY+=l,o=s.abs(this.distX),n=s.abs(this.distY),!(c-this.endTime>300&&10>o&&10>n)){if(this.directionLocked||this.options.freeScroll||(o>n+this.options.directionLockThreshold?this.directionLocked="h":n>=o+this.options.directionLockThreshold?this.directionLocked="v":this.directionLocked="n"),"h"==this.directionLocked){if("vertical"==this.options.eventPassthrough)t.preventDefault();else if("horizontal"==this.options.eventPassthrough)return void(this.initiated=!1);l=0}else if("v"==this.directionLocked){if("horizontal"==this.options.eventPassthrough)t.preventDefault();else if("vertical"==this.options.eventPassthrough)return void(this.initiated=!1);a=0}a=this.hasHorizontalScroll?a:0,l=this.hasVerticalScroll?l:0,i=this.x+a,e=this.y+l,(i>0||i0?0:this.maxScrollX),(e>0||e0?0:this.maxScrollY),this.directionX=a>0?-1:0>a?1:0,this.directionY=l>0?-1:0>l?1:0,this.moved||this._execEvent("scrollStart"),this.moved=!0,this._translate(i,e),c-this.startTime>300&&(this.startTime=c,this.startX=this.x,this.startY=this.y)}}},_end:function(t){if(this.enabled&&h.eventType[t.type]===this.initiated){this.options.preventDefault&&!h.preventDefaultException(t.target,this.options.preventDefaultException)&&t.preventDefault();var i,e,o=(t.changedTouches?t.changedTouches[0]:t,h.getTime()-this.startTime),n=s.round(this.x),r=s.round(this.y),a=s.abs(n-this.startX),l=s.abs(r-this.startY),c=0,p="";if(this.isInTransition=0,this.initiated=0,this.endTime=h.getTime(),!this.resetPosition(this.options.bounceTime)){if(this.scrollTo(n,r),!this.moved)return this.options.tap&&h.tap(t,this.options.tap),this.options.click&&h.click(t),void this._execEvent("scrollCancel");if(this._events.flick&&200>o&&100>a&&100>l)return void this._execEvent("flick");if(this.options.momentum&&300>o&&(i=this.hasHorizontalScroll?h.momentum(this.x,this.startX,o,this.maxScrollX,this.options.bounce?this.wrapperWidth:0,this.options.deceleration):{destination:n,duration:0},e=this.hasVerticalScroll?h.momentum(this.y,this.startY,o,this.maxScrollY,this.options.bounce?this.wrapperHeight:0,this.options.deceleration):{destination:r,duration:0},n=i.destination,r=e.destination,c=s.max(i.duration,e.duration),this.isInTransition=1),this.options.snap){var d=this._nearestSnap(n,r);this.currentPage=d,c=this.options.snapSpeed||s.max(s.max(s.min(s.abs(n-d.x),1e3),s.min(s.abs(r-d.y),1e3)),300),n=d.x,r=d.y,this.directionX=0,this.directionY=0,p=this.options.bounceEasing}return n!=this.x||r!=this.y?((n>0||n0||r0?i=0:this.x0?s=0:this.y-1&&this._events[t].splice(s,1)}},_execEvent:function(t){if(this._events[t]){var i=0,s=this._events[t].length;if(s)for(;s>i;i++)this._events[t][i].apply(this,[].slice.call(arguments,1))}},scrollBy:function(t,i,s,e){t=this.x+t,i=this.y+i,s=s||0,this.scrollTo(t,i,s,e)},scrollTo:function(t,i,s,e){e=e||h.ease.circular,this.isInTransition=this.options.useTransition&&s>0,!s||this.options.useTransition&&e.style?(this._transitionTimingFunction(e.style),this._transitionTime(s),this._translate(t,i)):this._animate(t,i,s,e.fn)},scrollToElement:function(t,i,e,o,n){if(t=t.nodeType?t:this.scroller.querySelector(t)){var r=h.offset(t);r.left-=this.wrapperOffset.left,r.top-=this.wrapperOffset.top,e===!0&&(e=s.round(t.offsetWidth/2-this.wrapper.offsetWidth/2)),o===!0&&(o=s.round(t.offsetHeight/2-this.wrapper.offsetHeight/2)),r.left-=e||0,r.top-=o||0,r.left=r.left>0?0:r.left0?0:r.top0?o--:0>i&&o++,e>0?n--:0>e&&n++,void this.goToPage(o,n);o=this.x+s.round(this.hasHorizontalScroll?i:0),n=this.y+s.round(this.hasVerticalScroll?e:0),o>0?o=0:o0?n=0:n-this.scrollerWidth;){for(this.pages[h]=[],t=0,n=0;n>-this.scrollerHeight;)this.pages[h][t]={x:s.max(l,this.maxScrollX),y:s.max(n,this.maxScrollY),width:c,height:p,cx:l-e,cy:n-o},n-=p,t++;l-=c,h++}else for(r=this.options.snap,t=r.length,i=-1;t>h;h++)(0===h||r[h].offsetLeft<=r[h-1].offsetLeft)&&(a=0,i++),this.pages[a]||(this.pages[a]=[]),l=s.max(-r[h].offsetLeft,this.maxScrollX),n=s.max(-r[h].offsetTop,this.maxScrollY),e=l-s.round(r[h].offsetWidth/2),o=n-s.round(r[h].offsetHeight/2),this.pages[a][i]={x:l,y:n,width:r[h].offsetWidth,height:r[h].offsetHeight,cx:e,cy:o},l>this.maxScrollX&&a++;this.goToPage(this.currentPage.pageX||0,this.currentPage.pageY||0,0),this.options.snapThreshold%1===0?(this.snapThresholdX=this.options.snapThreshold,this.snapThresholdY=this.options.snapThreshold):(this.snapThresholdX=s.round(this.pages[this.currentPage.pageX][this.currentPage.pageY].width*this.options.snapThreshold),this.snapThresholdY=s.round(this.pages[this.currentPage.pageX][this.currentPage.pageY].height*this.options.snapThreshold))}}),this.on("flick",function(){var t=this.options.snapSpeed||s.max(s.max(s.min(s.abs(this.x-this.startX),1e3),s.min(s.abs(this.y-this.startY),1e3)),300);this.goToPage(this.currentPage.pageX+this.directionX,this.currentPage.pageY+this.directionY,t)})},_nearestSnap:function(t,i){if(!this.pages.length)return{x:0,y:0,pageX:0,pageY:0};var e=0,o=this.pages.length,n=0;if(s.abs(t-this.absStartX)0?t=0:t0?i=0:ie;e++)if(t>=this.pages[e][0].cx){t=this.pages[e][0].x;break}for(o=this.pages[e].length;o>n;n++)if(i>=this.pages[0][n].cy){i=this.pages[0][n].y;break}return e==this.currentPage.pageX&&(e+=this.directionX,0>e?e=0:e>=this.pages.length&&(e=this.pages.length-1),t=this.pages[e][0].x),n==this.currentPage.pageY&&(n+=this.directionY,0>n?n=0:n>=this.pages[0].length&&(n=this.pages[0].length-1),i=this.pages[0][n].y),{x:t,y:i,pageX:e,pageY:n}},goToPage:function(t,i,e,o){o=o||this.options.bounceEasing,t>=this.pages.length?t=this.pages.length-1:0>t&&(t=0),i>=this.pages[t].length?i=this.pages[t].length-1:0>i&&(i=0);var n=this.pages[t][i].x,r=this.pages[t][i].y;e=void 0===e?this.options.snapSpeed||s.max(s.max(s.min(s.abs(n-this.x),1e3),s.min(s.abs(r-this.y),1e3)),300):e,this.currentPage={x:n,y:r,pageX:t,pageY:i},this.scrollTo(n,r,e,o)},next:function(t,i){var s=this.currentPage.pageX,e=this.currentPage.pageY;s++,s>=this.pages.length&&this.hasVerticalScroll&&(s=0,e++),this.goToPage(s,e,t,i)},prev:function(t,i){var s=this.currentPage.pageX,e=this.currentPage.pageY;s--,0>s&&this.hasVerticalScroll&&(s=0,e--),this.goToPage(s,e,t,i)},_initKeys:function(i){var s,e={pageUp:33,pageDown:34,end:35,home:36,left:37,up:38,right:39,down:40};if("object"==typeof this.options.keyBindings)for(s in this.options.keyBindings)"string"==typeof this.options.keyBindings[s]&&(this.options.keyBindings[s]=this.options.keyBindings[s].toUpperCase().charCodeAt(0));else this.options.keyBindings={};for(s in e)this.options.keyBindings[s]=this.options.keyBindings[s]||e[s];h.addEvent(t,"keydown",this),this.on("destroy",function(){h.removeEvent(t,"keydown",this)})},_key:function(t){if(this.enabled){var i,e=this.options.snap,o=e?this.currentPage.pageX:this.x,n=e?this.currentPage.pageY:this.y,r=h.getTime(),a=this.keyTime||0,l=.25;switch(this.options.useTransition&&this.isInTransition&&(i=this.getComputedPosition(),this._translate(s.round(i.x),s.round(i.y)),this.isInTransition=!1),this.keyAcceleration=200>r-a?s.min(this.keyAcceleration+l,50):0,t.keyCode){case this.options.keyBindings.pageUp:this.hasHorizontalScroll&&!this.hasVerticalScroll?o+=e?1:this.wrapperWidth:n+=e?1:this.wrapperHeight;break;case this.options.keyBindings.pageDown:this.hasHorizontalScroll&&!this.hasVerticalScroll?o-=e?1:this.wrapperWidth:n-=e?1:this.wrapperHeight;break;case this.options.keyBindings.end:o=e?this.pages.length-1:this.maxScrollX,n=e?this.pages[0].length-1:this.maxScrollY;break;case this.options.keyBindings.home:o=0,n=0;break;case this.options.keyBindings.left:o+=e?-1:5+this.keyAcceleration>>0;break;case this.options.keyBindings.up:n+=e?1:5+this.keyAcceleration>>0;break;case this.options.keyBindings.right:o-=e?-1:5+this.keyAcceleration>>0;break;case this.options.keyBindings.down:n-=e?1:5+this.keyAcceleration>>0;break;default:return}if(e)return void this.goToPage(o,n);o>0?(o=0,this.keyAcceleration=0):o0?(n=0,this.keyAcceleration=0):n=p?(n.isAnimating=!1,n._translate(t,i),void(n.resetPosition(n.options.bounceTime)||n._execEvent("scrollEnd"))):(f=(f-c)/s,m=e(f),d=(t-a)*m+a,u=(i-l)*m+l,n._translate(d,u),void(n.isAnimating&&r(o)))}var n=this,a=this.x,l=this.y,c=h.getTime(),p=c+s;this.isAnimating=!0,o()},handleEvent:function(t){switch(t.type){case"touchstart":case"MSPointerDown":case"mousedown":this._start(t);break;case"touchmove":case"MSPointerMove":case"mousemove":this._move(t);break;case"touchend":case"MSPointerUp":case"mouseup":case"touchcancel":case"MSPointerCancel":case"mousecancel":this._end(t);break;case"orientationchange":case"resize":this._resize();break;case"transitionend":case"webkitTransitionEnd":case"oTransitionEnd":case"MSTransitionEnd":this._transitionEnd(t);break;case"wheel":case"DOMMouseScroll":case"mousewheel":this._wheel(t);break;case"keydown":this._key(t);break;case"click":t._constructed||(t.preventDefault(),t.stopPropagation())}}},n.prototype={handleEvent:function(t){switch(t.type){case"touchstart":case"MSPointerDown":case"mousedown":this._start(t);break;case"touchmove":case"MSPointerMove":case"mousemove":this._move(t);break;case"touchend":case"MSPointerUp":case"mouseup":case"touchcancel":case"MSPointerCancel":case"mousecancel":this._end(t)}},destroy:function(){this.options.interactive&&(h.removeEvent(this.indicator,"touchstart",this),h.removeEvent(this.indicator,"MSPointerDown",this),h.removeEvent(this.indicator,"mousedown",this),h.removeEvent(t,"touchmove",this),h.removeEvent(t,"MSPointerMove",this),h.removeEvent(t,"mousemove",this),h.removeEvent(t,"touchend",this),h.removeEvent(t,"MSPointerUp",this),h.removeEvent(t,"mouseup",this)),this.options.defaultScrollbars&&this.wrapper.parentNode.removeChild(this.wrapper)},_start:function(i){var s=i.touches?i.touches[0]:i;i.preventDefault(),i.stopPropagation(),this.transitionTime(),this.initiated=!0,this.moved=!1,this.lastPointX=s.pageX,this.lastPointY=s.pageY,this.startTime=h.getTime(),this.options.disableTouch||h.addEvent(t,"touchmove",this),this.options.disablePointer||h.addEvent(t,"MSPointerMove",this),this.options.disableMouse||h.addEvent(t,"mousemove",this),this.scroller._execEvent("beforeScrollStart")},_move:function(t){var i,s,e,o,n=t.touches?t.touches[0]:t;h.getTime();this.moved||this.scroller._execEvent("scrollStart"),this.moved=!0,i=n.pageX-this.lastPointX,this.lastPointX=n.pageX,s=n.pageY-this.lastPointY,this.lastPointY=n.pageY,e=this.x+i,o=this.y+s,this._pos(e,o),t.preventDefault(),t.stopPropagation()},_end:function(i){if(this.initiated){if(this.initiated=!1,i.preventDefault(),i.stopPropagation(),h.removeEvent(t,"touchmove",this),h.removeEvent(t,"MSPointerMove",this),h.removeEvent(t,"mousemove",this),this.scroller.options.snap){var e=this.scroller._nearestSnap(this.scroller.x,this.scroller.y),o=this.options.snapSpeed||s.max(s.max(s.min(s.abs(this.scroller.x-e.x),1e3),s.min(s.abs(this.scroller.y-e.y),1e3)),300);(this.scroller.x!=e.x||this.scroller.y!=e.y)&&(this.scroller.directionX=0,this.scroller.directionY=0,this.scroller.currentPage=e,this.scroller.scrollTo(e.x,e.y,o,this.scroller.options.bounceEasing))}this.moved&&this.scroller._execEvent("scrollEnd")}},transitionTime:function(t){t=t||0,this.indicatorStyle[h.style.transitionDuration]=t+"ms",!t&&h.isBadAndroid&&(this.indicatorStyle[h.style.transitionDuration]="0.001s")},transitionTimingFunction:function(t){this.indicatorStyle[h.style.transitionTimingFunction]=t},refresh:function(){this.transitionTime(),this.options.listenX&&!this.options.listenY?this.indicatorStyle.display=this.scroller.hasHorizontalScroll?"block":"none":this.options.listenY&&!this.options.listenX?this.indicatorStyle.display=this.scroller.hasVerticalScroll?"block":"none":this.indicatorStyle.display=this.scroller.hasHorizontalScroll||this.scroller.hasVerticalScroll?"block":"none",this.scroller.hasHorizontalScroll&&this.scroller.hasVerticalScroll?(h.addClass(this.wrapper,"iScrollBothScrollbars"),h.removeClass(this.wrapper,"iScrollLoneScrollbar"),this.options.defaultScrollbars&&this.options.customStyle&&(this.options.listenX?this.wrapper.style.right="8px":this.wrapper.style.bottom="8px")):(h.removeClass(this.wrapper,"iScrollBothScrollbars"),h.addClass(this.wrapper,"iScrollLoneScrollbar"),this.options.defaultScrollbars&&this.options.customStyle&&(this.options.listenX?this.wrapper.style.right="2px":this.wrapper.style.bottom="2px"));this.wrapper.offsetHeight;this.options.listenX&&(this.wrapperWidth=this.wrapper.clientWidth,this.options.resize?(this.indicatorWidth=s.max(s.round(this.wrapperWidth*this.wrapperWidth/(this.scroller.scrollerWidth||this.wrapperWidth||1)),8),this.indicatorStyle.width=this.indicatorWidth+"px"):this.indicatorWidth=this.indicator.clientWidth,this.maxPosX=this.wrapperWidth-this.indicatorWidth,"clip"==this.options.shrink?(this.minBoundaryX=-this.indicatorWidth+8,this.maxBoundaryX=this.wrapperWidth-8):(this.minBoundaryX=0,this.maxBoundaryX=this.maxPosX),this.sizeRatioX=this.options.speedRatioX||this.scroller.maxScrollX&&this.maxPosX/this.scroller.maxScrollX),this.options.listenY&&(this.wrapperHeight=this.wrapper.clientHeight,this.options.resize?(this.indicatorHeight=s.max(s.round(this.wrapperHeight*this.wrapperHeight/(this.scroller.scrollerHeight||this.wrapperHeight||1)),8),this.indicatorStyle.height=this.indicatorHeight+"px"):this.indicatorHeight=this.indicator.clientHeight,this.maxPosY=this.wrapperHeight-this.indicatorHeight,"clip"==this.options.shrink?(this.minBoundaryY=-this.indicatorHeight+8,this.maxBoundaryY=this.wrapperHeight-8):(this.minBoundaryY=0,this.maxBoundaryY=this.maxPosY),this.maxPosY=this.wrapperHeight-this.indicatorHeight,this.sizeRatioY=this.options.speedRatioY||this.scroller.maxScrollY&&this.maxPosY/this.scroller.maxScrollY),this.updatePosition()},updatePosition:function(){var t=this.options.listenX&&s.round(this.sizeRatioX*this.scroller.x)||0,i=this.options.listenY&&s.round(this.sizeRatioY*this.scroller.y)||0;this.options.ignoreBoundaries||(tthis.maxBoundaryX?"scale"==this.options.shrink?(this.width=s.max(this.indicatorWidth-(t-this.maxPosX),8),this.indicatorStyle.width=this.width+"px",t=this.maxPosX+this.indicatorWidth-this.width):t=this.maxBoundaryX:"scale"==this.options.shrink&&this.width!=this.indicatorWidth&&(this.width=this.indicatorWidth,this.indicatorStyle.width=this.width+"px"),ithis.maxBoundaryY?"scale"==this.options.shrink?(this.height=s.max(this.indicatorHeight-3*(i-this.maxPosY),8),this.indicatorStyle.height=this.height+"px",i=this.maxPosY+this.indicatorHeight-this.height):i=this.maxBoundaryY:"scale"==this.options.shrink&&this.height!=this.indicatorHeight&&(this.height=this.indicatorHeight,this.indicatorStyle.height=this.height+"px")),this.x=t,this.y=i,this.scroller.options.useTransform?this.indicatorStyle[h.style.transform]="translate("+t+"px,"+i+"px)"+this.scroller.translateZ:(this.indicatorStyle.left=t+"px",this.indicatorStyle.top=i+"px")},_pos:function(t,i){0>t?t=0:t>this.maxPosX&&(t=this.maxPosX),0>i?i=0:i>this.maxPosY&&(i=this.maxPosY),t=this.options.listenX?s.round(t/this.sizeRatioX):this.scroller.x,i=this.options.listenY?s.round(i/this.sizeRatioY):this.scroller.y,this.scroller.scrollTo(t,i)},fade:function(t,i){if(!i||this.visible){clearTimeout(this.fadeTimeout),this.fadeTimeout=null;var s=t?250:500,e=t?0:300;t=t?"1":"0",this.wrapperStyle[h.style.transitionDuration]=s+"ms",this.fadeTimeout=setTimeout(function(t){this.wrapperStyle.opacity=t,this.visible=+t}.bind(this,t),e)}}},e.utils=h,"undefined"!=typeof module&&module.exports?module.exports=e:t.IScroll=e}(window,document,Math);
var _datMenuAnim="undefined"==typeof _datMenuAnim?400:_datMenuAnim,_datMenuEffect="undefined"==typeof _datMenuEffect?"effect-2":_datMenuEffect,_datMenuSublist="undefined"==typeof _datMenuSublist?!0:_datMenuSublist,_datMenuHeader="undefined"==typeof _datMenuHeader?!0:_datMenuHeader,_datMenuHeaderTitle="undefined"==typeof _datMenuHeaderTitle?'Poartus':_datMenuHeaderTitle,_datMenuSearch="undefined"==typeof _datMenuSearch?!0:_datMenuSearch,_datMenuCustomS="undefined"==typeof _datMenuCustomS?"fa-search":_datMenuCustomS,_datMenuCustomM="undefined"==typeof _datMenuCustomM?"fa-bars":_datMenuCustomM,_datMenuRootURL="undefined"==typeof _datMenuRootURL?"":_datMenuRootURL,myScroll;jQuery(document).on("ready",function(){var e=_datMenuSublist?" dat-submenu":"";Modernizr.csstransforms3d||jQuery("body").addClass("no-csstransforms3d"),jQuery("body").addClass("has-dat-menu").wrapInner(function(){return''}),jQuery("#dat-menu").append(''),_datMenuHeader&&(jQuery(".dat-menu-wrapper").addClass("dat-menu-padding"),jQuery(".dat-menu-container").prepend(''),_datMenuSearch&&jQuery(".dat-menu-top-header").prepend(''),jQuery(".dat-menu-top-header").prepend('')),jQuery(".dat-menu-top-header").delegate("input[type='text']","blur",function(){jQuery(".dat-menu-top-header").css("position","fixed").css("top","0px")}),jQuery(".dat-menu-top-header").delegate(".dat-menu-search","click",function(){return jQuery("html,body").animate({scrollTop:0}),jQuery(".dat-menu-top-header").css("position","absolute").css("top","0px"),jQuery(".dat-menu-top-header input[type='text']").focus(),!1}),jQuery(".load-responsive").each(function(){var e=jQuery(this),a="";e.attr("rel")&&(a='"),jQuery(".dat-menu-list > ul").append(a+e.html())}),jQuery(".dat-menu-list.dat-submenu > ul > li ul").each(function(){var e=jQuery(this).parent();e.addClass("dat-has-sub")});var a=["background","background-size","background-image","background-color","background-repeat","background-position"];jQuery.each(a,function(e,a){jQuery(".dat-menu-container").css(a,jQuery("body").css(a))}),jQuery("#dat-menu-list-inner li > a").on("click tap",function(){var e=jQuery(this).parent();if(0==e.hasClass("dat-has-sub")){var a=e.children("a");return window.location=a.attr("href"),!0}if(e.hasClass("dat-sub-active")){var a=e.children("a");return window.location=a.attr("href"),!0}return setTimeout(function(){e.addClass("dat-sub-active")},100),e.children("ul").children("li").css("display","none").animate({height:"toggle"},_datMenuAnim,function(){myScroll.refresh()}),!1}),jQuery(".dat-menu-container").on("mousedown",function(){var e=jQuery(this).parent();if(e.hasClass("dat-menu-load")){var a=Math.abs(parseInt(jQuery("#dat-menu > .dat-menu-container > .dat-menu-wrapper").css("top")));return e.removeClass("dat-menu-animate"),setTimeout(function(){e.removeClass("dat-menu-load"),e.removeClass("dat-menu-setup"),jQuery(document).scrollTop(a),jQuery("body").removeClass("datnomargin")},_datMenuAnim+100),!1}return!0}),jQuery("#wpadminbar").appendTo("body"),myScroll=new IScroll(".dat-menu-list",{scrollbars:!1,mouseWheel:!0,interactiveScrollbars:!1,shrinkScrollbars:"scale",fadeScrollbars:!1,tap:!0}),jQuery('a[href="#dat-menu"]').on("click",function(){var e=jQuery(document).scrollTop(),a=jQuery("#dat-menu");return a.find(".dat-menu-wrapper").css("top","-"+parseInt(e)+"px"),a.addClass("dat-menu-setup"),a.toggleClass("dat-menu-load"),setTimeout(function(){myScroll.refresh(),a.toggleClass("dat-menu-animate")},10),jQuery("body").addClass("datnomargin"),!1})});
var _otmBackTop=(typeof ot==="undefined")?true:(typeof ot._otmBackTop==="undefined")?true:ot._otmBackTop;
var _otmBackTopPos=(typeof ot==="undefined")?300:(typeof ot._otmBackTopPos==="undefined")?300:ot._otmBackTopPos;
var _otmBackTopSpeed=(typeof ot==="undefined")?80:(typeof ot._otmBackTopSpeed==="undefined")?80:ot._otmBackTopSpeed;
(function ($){
"use strict";
var breakingStart=true;
var breakingSpeed=40;
var breakingScroll=[0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
var breakingOffset=[0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
var elementsToClone=[true, true, true, true, true, true, true, true, true, true];
var elementsActive=[];
var theCount=[0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
var _ot_tresor_slider_ready=true;
Array.prototype.forEach2=function(a){ var l=this.length; for(var i=0;i 0){
if(!breakingStart){ return false; }
var theBreakingMargin=parseInt(thisitem.find(".br-article").css("margin-right"), 10),
theBreakingWidth=parseInt(thisitem.parent().css("width"), 10),
itemul=thisitem,
itemtemp=0,
items=itemul.find(".br-article").each(function(){
itemtemp=itemtemp+parseInt(jQuery(this).width(), 10) + parseInt(jQuery(this).css("padding-right"), 10) + parseInt(jQuery(this).css("margin-right"), 10);
});
theCount[thisindex]=(itemtemp / 2);
if(elementsToClone[thisindex]){
jQuery(this).parent().parent().parent().addClass("isscrolling");
jQuery('.br-article-list-inner').eq(thisindex).parent().parent().parent().attr("rel", thisindex);
thisitem.find(".br-article").clone().appendTo(this);
elementsToClone[thisindex]=false;
}
var theNumber=theCount[thisindex] + breakingOffset[thisindex];
if(Math.abs(theNumber) <=(Math.abs(breakingScroll[thisindex]))){
cloneBreakingLine(thisindex);
}
if(!elementsActive[thisindex]){
elementsActive[thisindex]=setInterval(function (){
beginScrolling(thisitem, thisindex);
}, breakingSpeed);
}}
});
setTimeout(function(){new start();}, breakingSpeed);
}
new start();
function beginScrolling(thisitem, thisindex){
breakingScroll[thisindex]=breakingScroll[thisindex] - 1;
thisitem.css("left", breakingScroll[thisindex] + 'px');
}
function cloneBreakingLine(thisindex){
breakingScroll[thisindex]=0;
jQuery('.br-article-list').eq(thisindex).find('.br-article-list-inner').css("left", "0px");
}
function scrollNimate(_element){
var datanime=_element.data("animation"),
uptimeout=0;
_element.children("div, a, blockquote").toArray().forEach2(function (a){
var coolem=jQuery(a);
coolem.css("visibility", "hidden");
setTimeout(function (){
coolem.css("visibility", "visible").addClass("animated "+datanime);
}, uptimeout);
uptimeout=uptimeout+200;
});
_element.removeClass("ot-scrollnimate");
return false;
}
window.onscroll=function(){
if(jQuery("#otm-back-to-top").length){
var scrollBarPosition=window.pageYOffset | document.body.scrollTop;
if(_otmBackTop){
var e=document.getElementById('otm-back-to-top');
if(scrollBarPosition >=_otmBackTopPos&&!e.classList.contains('active')){
e.classList.add("active");
}else if(scrollBarPosition < _otmBackTopPos&&e.classList.contains('active')){
e.classList.remove("active");
}}
}};
jQuery(document).on("ready", function(){
document.body.insertAdjacentHTML('beforeend', '');
var stollinghappening=false;
var scrollTop=function(startPos){
if(!stollinghappening) return false;
var scrollBarPosition=window.pageYOffset | document.body.scrollTop;
if(typeof startPos==="undefined"){startPos=scrollBarPosition;}
if(scrollBarPosition > 0){
window.scrollTo(0, startPos-(10*(_otmBackTopSpeed/10)));
setTimeout(function (){
scrollTop(Math.max(startPos-(10*(_otmBackTopSpeed/10)), 0));
}, (100/(_otmBackTopSpeed/10)));
}else{
stollinghappening=false;
}}
document.getElementById("otm-back-to-top").addEventListener('click', function(e){
e.preventDefault();
stollinghappening=true;
scrollTop();
return false;
});
jQuery("[data-ot-css]", "body").toArray().forEach2(function(a){
var thisel=jQuery(a);
thisel.attr("style", thisel.data("ot-css"));
});
var retina=window.devicePixelRatio > 1;
if(retina){
jQuery(".retina-check", "body").toArray().forEach2(function(a){
jQuery(a).addClass("go-retina");
});
var n=0;
jQuery("img[data-ot-retina]", "body").toArray().forEach2(function(a){
var thisel=jQuery(a);
var theImage=new Image();
if(thisel.data("ot-retina")=="") return false;
theImage.src=thisel.attr("src");
jQuery(theImage).load(function(){
var thisnew=jQuery(this);
thisel.attr("src", generatePlaceholder(thisnew[0].width,thisnew[0].height));
thisel.css({
"background-image": "url('"+thisel.data("ot-retina")+"')",
"background-size": "100% 100%",
"background-repeat": "none"
});
});
});
}
jQuery("[data-spacer-color]", ".shortcode-content").toArray().forEach2(function(a){
var thisel=jQuery(a);
thisel.css({"color": thisel.data("spacer-color"), "background-color": thisel.data("spacer-color")});
});
jQuery(".head-slider-wrap").each(function(){
jQuery(this).addClass("ot-loaded");
});
jQuery(".head-slider-nav a").click(function(){
if(!_ot_tresor_slider_ready)return false;
var thisel=jQuery(this);
_ot_tresor_slider_ready=false;
if(thisel.hasClass("active"))return false;
var differ=(thisel.index() < thisel.parent().children(".active").index())?" ot-go-left":"";
var famousindex=thisel.index();
if(thisel.hasClass("prev")){
famousindex=thisel.parent().children(".active").index();
famousindex=(famousindex-1 < 1)?thisel.parent().children().last().index()-1:famousindex-1;
differ=" ot-go-left";
}else if(thisel.hasClass("next")){
famousindex=thisel.parent().children(".active").index();
famousindex=(famousindex+1 >=thisel.parent().children().last().index())?thisel.parent().children().first().index()+1:famousindex+1;
differ="";
}
thisel.parent().children().eq(famousindex).addClass("active").siblings(".active").removeClass("active");
thisel.parent().siblings(".head-slider-wrap").css("height", (thisel.parent().siblings(".head-slider-wrap").height())+"px").children(".head-slider-slide").eq(famousindex-1).siblings(".active").removeClass("ot-go-left").addClass("diss"+differ).removeClass("active");
setTimeout(function(){
thisel.parent().siblings(".head-slider-wrap").css("height", "auto").children(".head-slider-slide").eq(famousindex-1).removeClass("ot-go-left").addClass("active"+differ);
_ot_tresor_slider_ready=true;
}, 500);
return false;
});
var otmatrix_class="strike-matrix",
otmatrix_innerclass="innerObject",
otmatrix_element=jQuery("."+otmatrix_class),
otmatrix_element_timeout;
setTimeout(function(){
otmatrix_element.each(function(){
var thisel=jQuery(this);
thisel.html("" + thisel.html() + "");
});
},200);
jQuery("."+otmatrix_class+"[data-matrix-href]").on('click', function(e){
window.location=jQuery(this).data("matrix-href");
});
otmatrix_element.mouseenter(function(e){
jQuery(this).removeClass("inactive");
jQuery(this).addClass("loadframe");
var thisel=jQuery(this);
setTimeout(function(){
otmatrix_element.removeClass("loadframe");
}, 100);
otmatrix_element_timeout=setTimeout(function(){
thisel.addClass("allowtomatrix");
}, 100);
});
jQuery("."+otmatrix_class).mousemove(function(e){
var mouse_x=e.pageX-jQuery(this).offset().left+2,
mouse_y=e.pageY-jQuery(this).offset().top,
fin_y=parseInt(100 / jQuery(this).height() * parseInt(mouse_y)),
fin_x=parseInt(100 / jQuery(this).width() * parseInt(mouse_x)),
zoom_size=(jQuery(this).data("matrix-zoom"))?parseFloat(jQuery(this).data("matrix-zoom")):2,
vertical=(((fin_y / 100) - 0.5) * zoom_size) / 10000,
horizontal=(((fin_x / 100) - 0.5) * zoom_size) / 10000,
zoom=0.98 - ((Math.abs(vertical*jQuery(this).height())+(Math.abs(horizontal*jQuery(this).width())))/2);
if(jQuery(this).hasClass("allowtomatrix")){
jQuery(this).children("."+otmatrix_innerclass).css({
"transform": "matrix3d("+zoom+",0,0.00,"+horizontal+",0.00,"+zoom+",0.00,"+vertical+",0,0,1,0,0,0,0,1)",
"opacity": zoom
});
}});
otmatrix_element.mouseleave(function(){
clearTimeout(otmatrix_element_timeout);
jQuery(this).addClass("inactive");
jQuery(this).removeClass("allowtomatrix");
});
jQuery("#main-menu .wrapper > ul > li").on("mouseenter", function(){
if(jQuery('.w-gallery-slider .item-header')){
var carousel=jQuery('.w-gallery-slider .item-header').data('owlCarousel');
if(carousel){
carousel._width=jQuery('.w-gallery-slider .item-header').width();
carousel.invalidate('width');
carousel.refresh();
}}
});
jQuery("input[type=text]", ".search-nav").on("focus blur", function(){
var thisel=jQuery(this);
if(thisel.val()!=""){
thisel.addClass("active");
}else{
thisel.removeClass("active");
}});
jQuery("button", ".photo-gallery-thumbs").on("click", function(){
var thisel=jQuery(this),
marginHandler=thisel.siblings(".photo-gallery-thumbs-inner").children(".item").eq(0),
current=thisel.siblings(".photo-gallery-thumbs-inner").data("thumbs-start-from");
if(thisel.hasClass("photo-gallery-nav-left")){
if(current+216 >=0){
current=0;
thisel.siblings(".photo-gallery-thumbs-inner").removeClass("not-first").removeClass("is-last");
}else{
current=current+216;
thisel.siblings(".photo-gallery-thumbs-inner").removeClass("is-last");
}}else
if(thisel.hasClass("photo-gallery-nav-right")){
var maxsize=(thisel.siblings(".photo-gallery-thumbs-inner").children(".item").size()*(78+8))-parseInt(jQuery(".photo-gallery-thumbs-inner", ".photo-gallery-thumbs").width(), 10);
if(current-216 <=(-1)*maxsize){
if(maxsize > 0){
current=(-1)*maxsize;
thisel.siblings(".photo-gallery-thumbs-inner").addClass("is-last");
}}else{
current=current-216;
thisel.siblings(".photo-gallery-thumbs-inner").addClass("not-first").removeClass("is-last");
}}
marginHandler.css("margin-left", current+"px");
thisel.siblings(".photo-gallery-thumbs-inner").data("thumbs-start-from", current);
return false;
});
jQuery("body").delegate(".lightbox", "click", function (e){
if(e.toElement&&/(lightbox|light-close|fa-times)/.test(jQuery(e.toElement).attr("class"))){
var thisel=(jQuery(e.toElement).hasClass("light-close"))?jQuery(this):jQuery(this);
console.log(thisel);
thisel.css('overflow', 'hidden');
jQuery("body").css('overflow', 'auto');
thisel.find(".lightcontent").fadeOut('fast');
thisel.fadeOut('slow');
return false;
}});
});
var menuisfollowing=false;
jQuery(window).on("scroll", function(){
var wr=jQuery(".ot-menu-will-follow .main-menu-placeholder").parent(),
wrfollow=jQuery(".ot-menu-will-follow .is-now-following");
if(wr.size() > 0&&jQuery(window).scrollTop() >=parseInt(wr.offset().top, 10)+280){
wr.addClass("smallify");
}else if(wrfollow.size() > 0&&jQuery(window).scrollTop() < parseInt(wrfollow.offset().top, 10)+280){
wrfollow.removeClass("smallify");
}
if(wr.size() > 0&&jQuery(window).scrollTop() >=parseInt(wr.offset().top, 10)&&menuisfollowing==false){
menuisfollowing=true;
wr.css({"height": wr.children(".main-menu-placeholder").height()});
wr.addClass("is-now-following");
}else if(wrfollow.size() > 0&&jQuery(window).scrollTop() < parseInt(wrfollow.offset().top, 10)&&menuisfollowing==true){
menuisfollowing=false;
wrfollow.removeClass("is-now-following").css({"height": "auto"});
}});
function generatePlaceholder(w, h){
var canvas=document.createElement('CANVAS'),
ctx=canvas.getContext('2d'),
img=new Image;
canvas.height=h;
canvas.width=w;
ctx.drawImage(img,0,0);
setTimeout(function(){
canvas=null;
}, 10);
return canvas.toDataURL('image/png');
}
setTimeout(function(){
jQuery('.theiaStickySidebar', "body").parent().theiaStickySidebar({
additionalMarginTop: 30
});
}, 100);
jQuery(".breaking-news").on("mouseenter", function (){
var thisindex=jQuery(this).attr("rel");
clearTimeout(elementsActive[thisindex]);
}).on("mouseleave", function (){
var thisindex=jQuery(this).attr("rel");
elementsActive[thisindex]=false;
});
})(jQuery);
var imageSrc="";
var thisimage="";
jQuery(document).ready(function(){
var photoCount=jQuery(".lightbox-photo").length;
jQuery(".lightbox-photo").click(function (){
var imageSrc=jQuery(this).attr("href");
var offset=jQuery(this).offset();
jQuery("body").before("");
if(jQuery(this).attr("title")){
jQuery("#lightbox-box > div > img").before(""+jQuery(this).attr("title")+"");
}
if(photoCount > 1){
jQuery("#lightbox-box > div > img").before("<-->");
}
setTimeout("setImageSize('"+imageSrc+"')", 500);
return false;
});
});
function takeNextPhoto(photo){
var imageSrc=jQuery(".lightbox-photo").eq(photo).attr("href");
setTimeout("setImageSize('"+imageSrc+"')", 500);
}
jQuery(window).resize(function(){
});
var thetop=0;
jQuery(document).scroll(function(){
if(jQuery("#lightbox-box > div")){
var winposition=parseInt(jQuery(window).scrollTop());
jQuery("#lightbox-box > div").css("top",(parseInt(winposition+thetop))+"px");
}});
function setImageSize(imageSrc){
var newImg=new Image();
newImg.onload=function(){
if((jQuery(window).height()-150) >=newImg.height&&jQuery(window).width() >=(newImg.width-150)){
var height=newImg.height;
var width=newImg.width;
}else{
if(jQuery(window).width() <=jQuery(window).height()){
if(newImg.width <=newImg.height){
var width=newImg.width / newImg.height * (jQuery(window).height()-150);
var height=newImg.height / newImg.width * width;
}else{
var height=newImg.height / newImg.width * (jQuery(window).width()-150);
var width=newImg.width / newImg.height * height;
}}else{
var width=newImg.width / newImg.height * (jQuery(window).height()-150);
var height=newImg.height / newImg.width * width;
}}
var winposition=jQuery(window).scrollTop();
jQuery("#lightbox-box > div > img").attr("src", "images/px.gif");
jQuery("#lightbox-box > div").css("height",height+"px").css("width",width+"px").css("top",((jQuery(window).height()/2)-(height/2)+winposition)+"px").css("left",((jQuery(window).width()/2)-(width/2))+"px");
jQuery("#lightbox-box").addClass("blackout");
thetop=parseInt((jQuery(window).height()/2)-(height/2));
setTimeout(function (){
jQuery("#lightbox-box > a").fadeIn("slow");
jQuery("#lightbox-box > div > span").fadeIn("slow");
jQuery("#lightbox-box > div > font").fadeIn("slow");
jQuery("#lightbox-box > div > img").attr("src", imageSrc);
thisimage=imageSrc;
}, 500);
}
jQuery(".lightbox-bg").click(function (){
jQuery(this).parent().remove();
}).children().click(function(e){
return false;
});
jQuery("#lightbox-box > a").click(function (){
jQuery(this).parent().remove();
return false;
});
jQuery("#lightbox-left").click(function (){
jQuery("#lightbox-box").removeClass("blackout");
var photoCount=jQuery(".lightbox-photo").length;
for(n=0;n div > span").remove();
if(jQuery(".lightbox-photo").eq(theone).attr("title")){
jQuery("#lightbox-box > div > img").before(""+jQuery(".lightbox-photo").eq(theone).attr("title")+"");
}
takeNextPhoto(theone);
return false;
});
jQuery("#lightbox-right").click(function (){
jQuery("#lightbox-box").removeClass("blackout");
var photoCount=jQuery(".lightbox-photo").length;
for(n=0;n=photoCount){
var theone=0;
}else{
var theone=parseInt(n)+1;
}}
}
jQuery("#lightbox-box > div > span").remove();
if(jQuery(".lightbox-photo").eq(theone).attr("title")){
jQuery("#lightbox-box > div > img").before(""+jQuery(".lightbox-photo").eq(theone).attr("title")+"");
}
takeNextPhoto(theone);
return false;
});
newImg.src=imageSrc;
};
(function (module){
if(typeof define==='function'&&define.amd){
define(['jquery'], module);
}else{
module(jQuery);
}})(function(jQuery, undefined){
var
threshold=6,
add=jQuery.event.add,
remove=jQuery.event.remove,
trigger=function(node, type, data){
jQuery.event.trigger(type, data, node);
},
requestFrame=(function(){
return (
window.requestAnimationFrame ||
window.webkitRequestAnimationFrame ||
window.mozRequestAnimationFrame ||
window.oRequestAnimationFrame ||
window.msRequestAnimationFrame ||
function(fn, element){
return window.setTimeout(function(){
fn();
}, 25);
}
);
})(),
ignoreTags={
textarea: true,
input: true,
select: true,
button: true
},
mouseevents={
move: 'mousemove',
cancel: 'mouseup dragstart',
end: 'mouseup'
},
touchevents={
move: 'touchmove',
cancel: 'touchend',
end: 'touchend'
};
function Timer(fn){
var callback=fn,
active=false,
running=false;
function trigger(time){
if(active){
callback();
requestFrame(trigger);
running=true;
active=false;
}else{
running=false;
}}
this.kick=function(fn){
active=true;
if(!running){ trigger(); }};
this.end=function(fn){
var cb=callback;
if(!fn){ return; }
if(!running){
fn();
}else{
callback=active ?
function(){ cb(); fn(); } :
fn ;
active=true;
}};}
function returnTrue(){
return true;
}
function returnFalse(){
return false;
}
function preventDefault(e){
e.preventDefault();
}
function preventIgnoreTags(e){
if(ignoreTags[ e.target.tagName.toLowerCase() ]){ return; }
e.preventDefault();
}
function isLeftButton(e){
return (e.which===1&&!e.ctrlKey&&!e.altKey);
}
function identifiedTouch(touchList, id){
var i, l;
if(touchList.identifiedTouch){
return touchList.identifiedTouch(id);
}
i=-1;
l=touchList.length;
while (++i < l){
if(touchList[i].identifier===id){
return touchList[i];
}}
}
function changedTouch(e, event){
var touch=identifiedTouch(e.changedTouches, event.identifier);
if(!touch){ return; }
if(touch.pageX===event.pageX&&touch.pageY===event.pageY){ return; }
return touch;
}
function mousedown(e){
var data;
if(!isLeftButton(e)){ return; }
data={
target: e.target,
startX: e.pageX,
startY: e.pageY,
timeStamp: e.timeStamp
};
add(document, mouseevents.move, mousemove, data);
add(document, mouseevents.cancel, mouseend, data);
}
function mousemove(e){
var data=e.data;
checkThreshold(e, data, e, removeMouse);
}
function mouseend(e){
removeMouse();
}
function removeMouse(){
remove(document, mouseevents.move, mousemove);
remove(document, mouseevents.cancel, removeMouse);
}
function touchstart(e){
var touch, template;
if(ignoreTags[ e.target.tagName.toLowerCase() ]){ return; }
touch=e.changedTouches[0];
template={
target: touch.target,
startX: touch.pageX,
startY: touch.pageY,
timeStamp: e.timeStamp,
identifier: touch.identifier
};
add(document, touchevents.move + '.' + touch.identifier, touchmove, template);
add(document, touchevents.cancel + '.' + touch.identifier, touchend, template);
}
function touchmove(e){
var data=e.data,
touch=changedTouch(e, data);
if(!touch){ return; }
checkThreshold(e, data, touch, removeTouch);
}
function touchend(e){
var template=e.data,
touch=identifiedTouch(e.changedTouches, template.identifier);
if(!touch){ return; }
removeTouch(template.identifier);
}
function removeTouch(identifier){
remove(document, '.' + identifier, touchmove);
remove(document, '.' + identifier, touchend);
}
function checkThreshold(e, template, touch, fn){
var distX=touch.pageX - template.startX,
distY=touch.pageY - template.startY;
if((distX * distX) + (distY * distY) < (threshold * threshold)){ return; }
triggerStart(e, template, touch, distX, distY, fn);
}
function handled(){
this._handled=returnTrue;
return false;
}
function flagAsHandled(e){
e._handled();
}
function triggerStart(e, template, touch, distX, distY, fn){
var node=template.target,
touches, time;
touches=e.targetTouches;
time=e.timeStamp - template.timeStamp;
template.type='movestart';
template.distX=distX;
template.distY=distY;
template.deltaX=distX;
template.deltaY=distY;
template.pageX=touch.pageX;
template.pageY=touch.pageY;
template.velocityX=distX / time;
template.velocityY=distY / time;
template.targetTouches=touches;
template.finger=touches ?
touches.length :
1 ;
template._handled=handled;
template._preventTouchmoveDefault=function(){
e.preventDefault();
};
trigger(template.target, template);
fn(template.identifier);
}
function activeMousemove(e){
var event=e.data.event,
timer=e.data.timer;
updateEvent(event, e, e.timeStamp, timer);
}
function activeMouseend(e){
var event=e.data.event,
timer=e.data.timer;
removeActiveMouse();
endEvent(event, timer, function(){
setTimeout(function(){
remove(event.target, 'click', returnFalse);
}, 0);
});
}
function removeActiveMouse(event){
remove(document, mouseevents.move, activeMousemove);
remove(document, mouseevents.end, activeMouseend);
}
function activeTouchmove(e){
var event=e.data.event,
timer=e.data.timer,
touch=changedTouch(e, event);
if(!touch){ return; }
e.preventDefault();
event.targetTouches=e.targetTouches;
updateEvent(event, touch, e.timeStamp, timer);
}
function activeTouchend(e){
var event=e.data.event,
timer=e.data.timer,
touch=identifiedTouch(e.changedTouches, event.identifier);
if(!touch){ return; }
removeActiveTouch(event);
endEvent(event, timer);
}
function removeActiveTouch(event){
remove(document, '.' + event.identifier, activeTouchmove);
remove(document, '.' + event.identifier, activeTouchend);
}
function updateEvent(event, touch, timeStamp, timer){
var time=timeStamp - event.timeStamp;
event.type='move';
event.distX=touch.pageX - event.startX;
event.distY=touch.pageY - event.startY;
event.deltaX=touch.pageX - event.pageX;
event.deltaY=touch.pageY - event.pageY;
event.velocityX=0.3 * event.velocityX + 0.7 * event.deltaX / time;
event.velocityY=0.3 * event.velocityY + 0.7 * event.deltaY / time;
event.pageX=touch.pageX;
event.pageY=touch.pageY;
timer.kick();
}
function endEvent(event, timer, fn){
timer.end(function(){
event.type='moveend';
trigger(event.target, event);
return fn&&fn();
});
}
function setup(data, namespaces, eventHandle){
add(this, 'movestart.move', flagAsHandled);
return true;
}
function teardown(namespaces){
remove(this, 'dragstart drag', preventDefault);
remove(this, 'mousedown touchstart', preventIgnoreTags);
remove(this, 'movestart', flagAsHandled);
return true;
}
function addMethod(handleObj){
if(handleObj.namespace==="move"||handleObj.namespace==="moveend"){
return;
}
add(this, 'dragstart.' + handleObj.guid + ' drag.' + handleObj.guid, preventDefault, undefined, handleObj.selector);
add(this, 'mousedown.' + handleObj.guid, preventIgnoreTags, undefined, handleObj.selector);
}
function removeMethod(handleObj){
if(handleObj.namespace==="move"||handleObj.namespace==="moveend"){
return;
}
remove(this, 'dragstart.' + handleObj.guid + ' drag.' + handleObj.guid);
remove(this, 'mousedown.' + handleObj.guid);
}
jQuery.event.special.movestart={
setup: setup,
teardown: teardown,
add: addMethod,
remove: removeMethod,
_default: function(e){
var template, data;
if(!e._handled()){ return; }
template={
target: e.target,
startX: e.startX,
startY: e.startY,
pageX: e.pageX,
pageY: e.pageY,
distX: e.distX,
distY: e.distY,
deltaX: e.deltaX,
deltaY: e.deltaY,
velocityX: e.velocityX,
velocityY: e.velocityY,
timeStamp: e.timeStamp,
identifier: e.identifier,
targetTouches: e.targetTouches,
finger: e.finger
};
data={
event: template,
timer: new Timer(function(time){
trigger(e.target, template);
})
};
if(e.identifier===undefined){
add(e.target, 'click', returnFalse);
add(document, mouseevents.move, activeMousemove, data);
add(document, mouseevents.end, activeMouseend, data);
}else{
e._preventTouchmoveDefault();
add(document, touchevents.move + '.' + e.identifier, activeTouchmove, data);
add(document, touchevents.end + '.' + e.identifier, activeTouchend, data);
}}
};
jQuery.event.special.move={
setup: function(){
add(this, 'movestart.move', jQuery.noop);
},
teardown: function(){
remove(this, 'movestart.move', jQuery.noop);
}};
jQuery.event.special.moveend={
setup: function(){
add(this, 'movestart.moveend', jQuery.noop);
},
teardown: function(){
remove(this, 'movestart.moveend', jQuery.noop);
}};
add(document, 'mousedown.move', mousedown);
add(document, 'touchstart.move', touchstart);
if(typeof Array.prototype.indexOf==='function'){
(function(jQuery, undefined){
var props=["changedTouches", "targetTouches"],
l=props.length;
while (l--){
if(jQuery.event.props.indexOf(props[l])===-1){
jQuery.event.props.push(props[l]);
}}
})(jQuery);
};});
(function (module){
if(typeof define==='function'&&define.amd){
define(['jquery'], module);
}else{
module(jQuery);
}})(function(jQuery, undefined){
var add=jQuery.event.add,
remove=jQuery.event.remove,
trigger=function(node, type, data){
jQuery.event.trigger(type, data, node);
},
settings={
threshold: 0.4,
sensitivity: 6
};
function moveend(e){
var w, h, event;
w=e.target.offsetWidth;
h=e.target.offsetHeight;
event={
distX: e.distX,
distY: e.distY,
velocityX: e.velocityX,
velocityY: e.velocityY,
finger: e.finger
};
if(e.distX > e.distY){
if(e.distX > -e.distY){
if(e.distX/w > settings.threshold||e.velocityX * e.distX/w * settings.sensitivity > 1){
event.type='swiperight';
trigger(e.currentTarget, event);
}}else{
if(-e.distY/h > settings.threshold||e.velocityY * e.distY/w * settings.sensitivity > 1){
event.type='swipeup';
trigger(e.currentTarget, event);
}}
}else{
if(e.distX > -e.distY){
if(e.distY/h > settings.threshold||e.velocityY * e.distY/w * settings.sensitivity > 1){
event.type='swipedown';
trigger(e.currentTarget, event);
}}else{
if(-e.distX/w > settings.threshold||e.velocityX * e.distX/w * settings.sensitivity > 1){
event.type='swipeleft';
trigger(e.currentTarget, event);
}}
}}
function getData(node){
var data=jQuery.data(node, 'event_swipe');
if(!data){
data={ count: 0 };
jQuery.data(node, 'event_swipe', data);
}
return data;
}
jQuery.event.special.swipe =
jQuery.event.special.swipeleft =
jQuery.event.special.swiperight =
jQuery.event.special.swipeup =
jQuery.event.special.swipedown={
setup: function(data, namespaces, eventHandle){
var data=getData(this);
if(data.count++ > 0){ return; }
add(this, 'moveend', moveend);
return true;
},
teardown: function(){
var data=getData(this);
if(--data.count > 0){ return; }
remove(this, 'moveend', moveend);
return true;
},
settings: settings
};});